Posts

Showing posts from October 19, 2010

About Java Servlet Life Cycle

Servlet Life Cycle:-     There are three methods which describe the Servlet Life Cycle.    init() Method:- When servlet class is instantiate, servlet container called ths init() method. The init() method is being called before receiving any request by servlet container.      init() method takes ServletConfig object as a parameter and throw exception ServletException. Signatute of this method is     public void init(ServletConfig config) throws ServletException . service() Method:- When servlet is instantiate properly. Servlet container called the service() method. This method handle the client request and give the response back to the client.     service() method takes two parameter named ServletRequest and ServletResponse and throw ServletException and IOException. Signatute of this method is     public void service(ServletRequest req, ServletResponse res) throws ServletException, IOEx...

about java servlet concept

Servlet:-     A servlet is a componet or java class which is run over the servlet container. Servlet completly handle client request and response through HTTP. So that servlet engine must be support HTTP. For writing a servlet, in java there ia a package javax.servlet. Javax.servlet Package:-     javax.servlet package has 7 interfaces, 3 classes and 2 exceptions Interfaces inside javax.servlet:-     1)Request Dispatcher     2)Servlet     3)Servlet Config     4)Servlet Context     5)ServletRequester     6)ServletResponse     7)SingleThreadModel Classes inside javax.servlet:-     1)GenericServlet     2)ServletInputStream     3)ServletOutputStream Exceptions inside javax.servlet:-     1)ServletException     2)UnavailableException

MVC Design Pattern java

  MVC Design Pattern:-           MVC Design Pattern made with three components (Layer ).            M ---> Denotes Model components            V ---> Denotes View components            C ----> Denotes Controller components Model component:-           In Model component we represent data objects. Model component is being manipulated and present to the user. View component:-          View component represent data on html pages which is manipulate in the Model component. Controller components:-          Controller component handle all the things from handle request and response to client.

Recent Post

Recent Posts Widget