How To Create Servelets In Java?
Can't find what you're looking for?
Ask a Question, Get an Answer ASAP
A very simple hello world servlet would look like this:
package test;
import java.io.*;
import javax.servlet.http.*;
import javax.servlet.*;
public class HelloServlet extends HttpServlet {
public void doGet (HttpServletRequest req,
HttpServletResponse res)
throws ServletException, IOException
{
PrintWriter out = res.getWriter();
out.println("Hello, world!");
out.close();
}
}
answered 2 years ago
Ask questions on any topic, get great answers from real people for FREE. Blurtit has hundreds of thousand of members so your sure to get the answer your looking for.