<url-pattern>/shop/ShoppingServlet</url-pattern>
</servlet-mapping>
5、session-config
<session-config></session-config> 用来定义web站台中的session参数,包含一个子元素:
<session-timeout></session-timeout> 用来定义这个web站台所有session的有效期限,单位为 分钟
6、mime-mapping
<mime-mapping></mime-mapping> 定义某一个扩展名和某一个MIME Type做对映,包含两个子元素: <extension></extension> 扩展名的名称
<mime-type></mime-type> MIME格式
比如:
<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>
7、welcom-file-list
<welcome-file-list></welcom-file-list> 用来定义首页的列单,包含一个子元素:
<welcome-file></welcome-file> 指定首页的文件名称
比如:
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
<welcome-file>index.html</welcome-file>
</welcom-file-list>
8、error-page
<error-page></error-page> 用来处理错误代码或异常的页面,有三个子元素:
<error-code></error-code> 指定错误代码
<exception-type></exception-type> 指定一个JAVA异常类型
<location></location> 指定在web站台内的相关资源路径
web.xml中的参数context-param和init-param区别_IT/计算机_专业资料。web.xml...web.xml 中的参数 context-param 和 init-param 区别 2010-03-15 09:15:39...
监听器与context-prama标记的使用_IT/计算机_专业...ContextLoaderListener 的作用就是启动 Web 容器时,...<context-param> <param-name>contextConfigLocation...
init()与service()区别_计算机软件及应用_IT/计算机_专业资料。servlet中init(...context-param与init-pa... 13页 免费 web project和web servi... 5页 免费...
的init()方法中通过this.getInitParameter("param1"...ServletContext(); context-param的值 = ...但是他们并不同 <context-param>是application范围内...
(不同作用域数据的比 较),访问应用程序级初始化参数(context-param 与 init-param 比较),将消息记录到 应用程序日志文件中; Servlet 通信:向浏览器发送错误消息...
Detached状态和Transient状态的区别在于Detached状态的...()的作用是将数据库与缓存中的数据同步 11题:...<context-param> <param-name>contextConfigLocation...
-param> <param-name>contextConfigLocation</param-...视图 视图的作用是渲染模型数据,将模型里的数据以...为逻辑视图名的解析提供了不同的策略,可以在 Spring...
Servlet高级部分 说明我们今天讲的大部分是Servlet比较...init()方法 Init的作用? Init()方法 public void...servletContext 取得初始参数配置: <context-param> ...
两者的区别;画图演示,说明道理 Servlet实例 ? 实现...Init的作用? Init()方法 public void init(){ ?...context-param ServletContext对象 ? 与资源相关的...
热门文档