It is currently Fri May 18, 2012 5:44 pm


Post a new topicPost a reply Page 1 of 1   [ 1 post ]
Author Message
 Post subject: Servlets
PostPosted: Tue Sep 14, 2010 7:34 am 
Site Admin

Joined: Sat Aug 02, 2008 8:00 am
Posts: 147
Servlets
1.

Lifecycle of a Servlet

The servlet lifecycle consists of the following steps: Here is a simple servlet that just generates HTML. Note that HttpServlet is a subclass of GenericServlet, an implementation of the Servlet interface. The service() method dispatches requests to methods doGet(), doPost(), doPut(), doDelete(), etc., according to the HTTP request. import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; public class HelloWorld extends HttpServlet { public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println("\n" + "\n" + "Hello WWW\n" + "\n" + "Hello WWW\n" + ""); } }

_________________

Muhammad Safwat Fuad
The Java Code Admin
Java Technical Lead.
Mobile: +2010-2942-538
Email:mtv134@yahoo.com


Top
 Profile Send private message  
 
Display posts from previous:  Sort by  
Post a new topicPost a reply Page 1 of 1   [ 1 post ]


Who is online

Registered users: Burogyloalo, RepImpedhex


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
twilightBB Style by Daniel St. Jules of Gamexe.net

[
SEO MOD © 2007 StarTrekGuide ]