【 tulaoshi.com - Web开发 】
1.5创建一个部署描述文件
·为你的servlets注册并且创建一个url mapping
·注册并指定应用中的监听器和过滤器
·指定上下文中的初始化参数。
·配置错误页,和欢迎页
·配置seeion 超时
?xml version="1.0" encoding="ISO-8859-1"?
!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-application_2_3.dtd"
web-app
display-nameServlet 2.3 deployment descriptor/display-name
filter
filter-nameRequestFilter/filter-name
filter-classcom.mydev.RequestFilter/filter-class
/filter
filter-mapping
filter-nameRequestFilter/filter-name
url-pattern/*/url-pattern
/filter-mapping
listener
listener-classcom.mydev.ReqListener/listener-class
/listener
servlet
servlet-nameMyServlet/servlet-name
servlet-classcom.mydev.MyServlet/servlet-class
/servlet
servlet-mapping
servlet-name MyServlet /servlet-name
url-pattern/myservlet/url-pattern
/servlet-mapping
session-config
session-timeout15/session-timeout
/session-config error-page
error-code404/error-code
location/err404.jsp/location
/error-page
/web-app
http://blog.csdn.net/bruceleey/archive/2007/02/07/1503854.aspx