Create a configuration file for a Web application
For struts applications, its configuration file web.xml should be configured for the Actionservlet class, and the Struts tag library used by Web applications should be declared, in this case, three tag libraries are declared: Struts Bean, struts HTML and Struts logic tag library. Routine 1 is the source code for the Web.xml.
Routine 1 Web.xml
<?xml version= "1.0" encoding= "UTF-8"
<! DOCTYPE web-app
Public "-//sun Microsystems, INC.//DTD Web application 2.2//en"
"http://java.sun.com/j2ee/dtds/ Web-app_2_2.dtd "
<web-app>
<display-name>helloapp Struts application</display-name>
<!--Standard Action Servlet Configuration
<servlet>
<servlet-name>action</ Servlet-name>
<servlet-class>org.apache.struts.action.actionservlet</servlet-class>
< Init-param>
<param-name>config</param-name>
<param-value>/web-inf/struts-config.xml </param-value>
</init-param>
<load-on-startup>2</load-on-startup>
</ Servlet>
<!--Standard Action Servlet Mapping
<servlet-mapping>
<servlet-name> Action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
< !--the usual Welcome File List--
<welcome-file-list>
<welcome-file>hello.jsp</welcome-file>
</ Welcome-file-list>
<!--Struts Tag Library descriptors;
<taglib>
<taglib-uri>/ Web-inf/struts-bean.tld</taglib-uri>
<taglib-location>/web-inf/struts-bean.tld</ Taglib-location>
</taglib>
<taglib>
<taglib-uri>/web-inf/struts-html.tld</ Taglib-uri>
<taglib-location>/web-inf/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/web-inf/struts-logic.tld</taglib-uri>
<taglib-location >/web-inf/struts-logic.tld</taglib-location>
</taglib>
</web-app>