Friday, December 24, 2010

Struts Life Cycle

Life Cycle Of Struts Or Flow Of Struts:

When the Framework is loaded, it first loaded the Web.xml
file. Then from the Servlet tag of Web.xml, it identifies
the ActionServlet(or the Struts-Cofig.xml). Then from
welcome-file tag of web.xml, it identifies the
first JSP page and runs it. Then when the request comes
through that jsp, from acion-mappings tag of Struts-
Cofig.xml it identifies the request, through path tag
(request name) and input tag (jsp name), through name tag
it identifies which bean is needed to access the data and
through type tag it identifies which Action should be
invoked. Then through the forward tag it identifies to
which jsp it has to forward the response.

load-on-startup element in web.xml


This tips explains the few points on how to use the load-on-startup element on the web.xml file. When erver is starting, it is possible to tell the container to load a servlet on the startup. You can load any number of servlets on the startup. Normally this is done for any initialization purpose. Look into the following example:

&ltservlet&gt
&ltservlet-name&gtTestServlet&lt/servlet-name&gt
&ltservlet-class&gtTestServlet&lt/servlet-class&gt
&ltload-on-startup&gt1&lt/load-on-startup&gt
&lt/servlet&gt


The above example tells the container that the servlet will be loaded at first.The sub-element indicates the order in which each servlet should be loaded. Lower positive values are loaded first. If the value is negative or unspecified, then the container can load the servlet at anytime during startup.

job sites

http://www.chetanasforum.com/index.php?showforum=4


http://www.chetanasforum.com/index.php?act=announce&f=4&id=4

No comments:

Post a Comment

Search This Blog