请问如何配置WEB.XML?听说SCWCD中考了不少,急~~~~

deeprising 2002-05-01 11:34:47
如题
...全文
7 点赞 收藏 2
写回复
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
deeprising 2002-05-07
谢谢~~~请问在tomcat,resin等中配置都一样吗
回复
cxmlc 2002-05-04
<?xml version="1.0" encoding="UTF-8" ?>
- <!-- edited with XML Spy v3.5 NT (http://www.xmlspy.com) by ()
-->
<!DOCTYPE web-app (View Source for full doctype...)>
- <web-app>
<display-name>SCWCD</display-name>
<description>学习配置DD</description>
- <context-param>
<param-name>user</param-name>
<param-value>scwd</param-value>
</context-param>
- <context-param>
<param-name>password</param-name>
<param-value>scwcd</param-value>
</context-param>
- <listener>
<listener-class>javax.servlet.http.HttpSessionListener</listener-class>
</listener>
- <servlet>
<servlet-name>index</servlet-name>
<servlet-class>servlets.index</servlet-class>
- <init-param>
<param-name>name</param-name>
<param-value>servlet</param-value>
</init-param>
- <init-param>
<param-name>password</param-name>
<param-value>scwcd</param-value>
</init-param>
- <security-role-ref>
<role-name>my</role-name>
</security-role-ref>
</servlet>
- <servlet-mapping>
<servlet-name>index</servlet-name>
<url-pattern>/index</url-pattern>
</servlet-mapping>
- <session-config>
<session-timeout>30</session-timeout>
</session-config>
- <mime-mapping>
<extension>html</extension>
<mime-type>text/html</mime-type>
</mime-mapping>
- <mime-mapping>
<extension>doc</extension>
<mime-type>application/msword</mime-type>
</mime-mapping>
- <welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.htm</welcome-file>
</welcome-file-list>
- <error-page>
<error-code>404</error-code>
<location>error/404.html</location>
</error-page>
- <error-page>
<exception-type>java.lang.Exception</exception-type>
<location>error/exception.html</location>
</error-page>
- <taglib>
<taglib-uri>/mytld</taglib-uri>
<taglib-location>/WEB-INF/tlds/mytld/tld</taglib-location>
</taglib>
- <security-constraint>
- <web-resource-collection>
<web-resource-name>my</web-resource-name>
<url-pattern>/index</url-pattern>
<url-pattern>/admin/*</url-pattern>
<http-method>get</http-method>
</web-resource-collection>
- <auth-constraint>
<description>Secury Test</description>
<role-name>Admin</role-name>
</auth-constraint>
- <user-data-constraint>
<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
- <login-config>
<auth-method>FORM</auth-method>
<realm-name>Form Based Scuruty</realm-name>
- <form-login-config>
<form-login-page>/login.html</form-login-page>
<form-error-page>/error.html</form-error-page>
</form-login-config>
</login-config>
- <security-role>
<role-name>my</role-name>
<description>这是一个安全规则</description>
</security-role>
</web-app>
回复
发动态
发帖子
Web 开发
创建于2007-09-28

7.9w+

社区成员

Java Web 开发
申请成为版主
社区公告
暂无公告