Friday, August 6, 2010

Servlet Example

import javax.servlet.*;
import javax.servlet.http.*;

public class SomeServlet extends HttpServlet {
  public void doGet(HttpServletRequest request,
                    HttpServletResponse response)
      throws ServletException, IOException {
    PrintWriter out = response.getWriter();
    // Use "out" to send content to browser
    out.println("Hello i m first servlet");

when this servlet invoke the output will be "Hello i m first servlet"

No comments:

Post a Comment