import javax.servlet.*; import javax.servlet.http.*; public class MyServlet extends HttpServlet { @Override public void init(ServletConfig sconfig) throws ServletException { super.init(sconfig); // Do stuff } @Override public void doGet(HttpServletRequest request_in, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("hello <b>World</b>"); } @Override public void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { doGet(request, response); } }
Programming Tips - Java: A basic Java servlet (example)
Date: 2013nov22
Language: Java
Keywords: minimal
Q. Java: A basic Java servlet (example)
A.