1 19 20 package org.netbeans.modules.servlettest; 21 22 import java.io.*; 23 import java.net.*; 24 25 import javax.servlet.*; 26 import javax.servlet.http.*; 27 28 32 public class ModuleServlet extends HttpServlet { 33 34 36 public void init (ServletConfig config) throws ServletException { 37 super.init (config); 38 } 39 40 44 protected void processRequest (HttpServletRequest request, HttpServletResponse response) 45 throws ServletException, IOException { 46 response.setContentType ("text/plain"); 47 PrintWriter out = response.getWriter (); 48 49 out.println("Test data output from ModuleServlet"); 50 out.close (); 51 } 52 53 57 protected void doGet (HttpServletRequest request, HttpServletResponse response) 58 throws ServletException, IOException { 59 processRequest (request, response); 60 } 61 62 66 protected void doPost (HttpServletRequest request, HttpServletResponse response) 67 throws ServletException, IOException { 68 processRequest (request, response); 69 } 70 71 73 public String getServletInfo () { 74 return "Short description"; 75 } 76 77 } 78 | Popular Tags |