<servlet-mapping>
<servlet-name>errorDispatcher</servlet-name>
<url-pattern>/errorDispatcher</url-pattern>
</servlet-mapping>
<!-- Struts Controller servlet mapping, see Chapter 18 -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!--
Uncomment if you want all exceptions and 500 status codes to
be handled by the customized error page.
<error-page>
<exception-type>java.lang.Throwable</exception-type>
<location>/errorDispatcher</location>
</error-page>
<error-page>
<error-code>500</error-code>
<location>/errorDispatcher</location>
</error-page>
-->
<!--
This resource reference is only used to test the JNDI config described
in Chapter 23. None of the examples use it.
-->
<resource-ref>
<description>
JNDI DataSource for example database
</description>
<res-ref-name>jdbc/Example</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Sharable</res-sharing-scope>
</resource-ref>
<!-- Security constraints for examples in Chapter 12 -->
<security-constraint>
<web-resource-collection>
<web-resource-name>admin</web-resource-name>
<url-pattern>/ch12/admin/*</url-pattern>
<url-pattern>/ch12/search/delete.jsp</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
</security-constraint>
<security-constraint>
<web-resource-collection>
<web-resource-name>search</web-resource-name>
<url-pattern>/ch12/search/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<role-name>admin</role-name>
<role-name>user</role-name>
</auth-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>ORA Examples</realm-name>
</login-config>
<security-role>
<role-name>admin</role-name>
</security-role>
<security-role>
<role-name>user</role-name>
</security-role>
</web-app>
另外在网上找到了一个家伙写的web.xml
<?xml version="1.0" encoding="UTF-8"?>