<?xml version="1.0" encoding="UTF-8"?> <web-app> <!-- 1.icon --> <icon></icon> <!-- 2.display-name 定义站台的名称 --> <display-name></display-name> <!-- 3.description 是对站台的描述 --> <description></description> <!-- 4.context-param 用来设定web站台的环境参数 --> <context-param> <param-name>param_name</param-name> <param-value>param_value</param-value> </context-param> <!-- 5.filter --> <filter> <!-- 配置Struts2核心Filter的名字 --> <filter-name>struts2</filter-name> <!-- 配置Struts2核心Filter的实现类 --> <filter-class>org.apache.struts2.dispatcher.FilterDispatcher </filter-class> <init-param> <!-- 配置Struts2框架默认加载的Action包结构,可以没有。 --> <param-name>actionPackages</param-name> <param-value>org.apache.struts2.showcase.person</param-value> </init-param> <!-- 配置Struts2框架的配置提供者类 --> <init-param> <param-name>configProviders</param-name> <param-value>lee.MyConfigurationProvider</param-value> </init-param> </filter> <!-- 6.filter-mapping --> <!-- 配置Filter拦截的URL --> <filter-mapping> <!-- 配置Struts2的核心FilterDispatcher拦截所有用户请求 --> <filter-name>struts2</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- 7.listener --> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <!-- 8.servlet 用来声明一个servlet的数据 --> <servlet> <servlet-name>dwr-invoker</servlet-name> <display-name>DWR Servlet</display-name> <description>Direct Web Remoter Servlet</description> <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>true</param-value> </init-param> </servlet> <!-- 9.servlet-mapping --> <servlet-mapping> <servlet-name>dwr-invoker</servlet-name> <url-pattern>/dwr/*</url-pattern> </servlet-mapping> <!-- 10.session-config 用来定义web站台中的session参数 --> <session-config> <session-timeout>30</session-timeout> </session-config> <!-- 11.mime-mapping --> <mime-mapping> <extension>doc</extension> <mime-type>application/vnd.ms-word</mime-type> </mime-mapping> <mime-mapping> <extension>xls</extension> <mime-type>application/vnd.ms-excel</mime-type> </mime-mapping> <!-- 12.welcome-file-list 用来定义首页的列单 --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> <welcome-file>index.html</welcome-file> </welcome-file-list> <!-- 13.error-page --> <error-page> <error-code>404</error-code> <location>/error404.jsp</location> </error-page> <error-page> <exception-type>java.lang.Exception</exception-type> <location>/exception.jsp</location> </error-page> <!-- 14.jsp-config --> <jsp-config></jsp-config> <!-- 15.resource-env-ref --> <resource-env-ref> <resource-env-ref-name>jdbc/mssql</resource-env-ref-name> <resource-env-ref-type>javax.sql.DataSource</resource-env-ref-type> </resource-env-ref> <!-- 16.resource-ref --> <resource-ref> <description>JNDI JDBC DataSource</description> <res-ref-name>jdbc/data</res-ref-name> <res-type>javax.sql.DataSoruce</res-type> <res-auth>Container</res-auth> </resource-ref> <!-- 17.security-constraint --> <security-constraint> <display-name>Example Security Constraint</display-name> <web-resource-collection> <web-resource-name>Protected Area</web-resource-name> <url-pattern>/jsp/security/protected/*</url-pattern> <http-method>DELETE</http-method> <http-method>GET</http-method> <http-method>POST</http-method> <http-method>PUT</http-method> </web-resource-collection> <auth-constraint> <role-name>tomcat</role-name> <role-name>role1</role-name> </auth-constraint> </security-constraint> <!-- 18.login-config --> <login-config> <auth-method>FORM</auth-method> <realm-name>Example-Based Authentiation Area</realm-name> <form-login-config> <form-login-page>/jsp/security/protected/login.jsp</form-login-page> <form-error-page>/jsp/security/protected/error.jsp</form-error-page> </form-login-config> </login-config> <!-- 19.security-role --> <security-role> <role-name>tomcat</role-name> </security-role> <!-- 20.env-entry --> <env-entry> <env-entry-name>minExemptions</env-entry-name> <env-entry-value>1</env-entry-value> <env-entry-type>java.lang.Integer</env-entry-type> </env-entry> <!-- 21.ejb-ref --> <ejb-ref> <description>Example EJB reference</description> <ejb-ref-name>ejb/Account</ejb-ref-name> <ejb-ref-type>Entity</ejb-ref-type> <home>com.mycompany.mypackage.AccountHome</home> <remote>com.mycompany.mypackage.Account</remote> </ejb-ref> <!-- 22.ejb-local-ref --> <ejb-local-ref> <description>Example Loacal EJB reference</description> <ejb-ref-name>ejb/ProcessOrder</ejb-ref-name> <ejb-ref-type>Session</ejb-ref-type> <local-home>com.mycompany.mypackage.ProcessOrderHome</local-home> <local>com.mycompany.mypackage.ProcessOrder</local> </ejb-local-ref> </web-app>
时间: 2024-10-26 05:57:00