I am learning Servlets.
In web.xml of an application, I found the following Servlet code.
Can somebody please explain me the significance of the code
<servlet id="Servlet_1060120206078">
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param id="InitParam_1060120206077">
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param id="InitParam_1060120206076">
<param-name>debug</param-name>
<param-value>2</param-value>
</init-param>
<init-param id="InitParam_1069371544495">
<param-name>detail</param-name>
<param-value>2</param-value>
</init-param>
<init-param id="InitParam_1069371544496">
<param-name>validate</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</servlet>
Thanks
Nirmalya
This is just defining a servlet (in this case a FrontController for Struts) that is used to handle requests. Later on in the file I’m sure you’ll also find a servlet mapping that maps this servlet to http requests.
The
<init-param>elements are key/value pairs that the servlet can read on startup. Struts uses these for configuration.All the InitParam_XXX stuff is un-necessary, my guess is that it was machine generated by some editor.
Check this out for more details:
http://netbeans.org/kb/docs/web/quickstart-webapps-struts.html