性能優勢 ?Run in the same context as application server ?執行并且駐留在內存中 ?有請求時提前被裝入或裝入 ?通過HTTP請求維持對話 ?減輕后置系統的負擔 ?多線程 ?可伸縮于多處理器以及多機種系統(IBM WebSphere Performance Pack)
public class MyServlet extends HttpServlet { public void doGet( HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException { // get stream to output HTML on! res. setContentType(" text/ html"); PrintWriter out = res. getWriter();