Java Web 应用web.xml配置 --Servlet映射配置
来源:互联网 发布:我感受到了网络的魅力 编辑:程序博客网 时间:2024/04/30 11:06
在每个javaWeb应用中,都有一个web.xml配置文件,该文件中配置了该web应用中的servlet的映射关系,现在主要记下的是<servlet-mapping>部分的一些说明。
所有的servlet映射配置都是基于web应用的contextpath而言的, 例如:如果web应用的名称是cmis,部署在本地的tomcat6服务器,端口是8080,那么该web应用的contextpath就是http://localhost:8080/cmis ,该路径可以通过request.getContextPath()得到,比如,<a href=" <%=request.getContextPath()%>/eschainstudio.jnlp">流程定制</a>,则点击该超链接后,将链接到 http://localhost:8080/cmis/eschainstudio.jnlp, 现在, 来看看servlet的映射,
<servlet-mapping>
<servlet-name>studiojnlpservlet</servlet-name>
<url-pattern>/eschainstudio.jnlp</url-pattern>
</servlet-mapping>
表示,当请求的url是 http://localhost:8080/cmis/eschainstudio.jnlp的时候,会转到名称为studiojnlpservlet的servlet进行处理,可见,默认的,在所有的servlet的映射的配置中,都已经在<url-pattern>的前面加上了contextpath,在比如,
<servlet-mapping>
<servlet-name>CMISMvcServlet</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
,
则表示,当请求的url是 http://localhost:8080/cmis +任何内容+.do的时候, 将转入名称是 CMISMvcServlet的 servlet 中进行处理。
以此类推。
- Java Web 应用web.xml配置 --Servlet映射配置
- java web.xml配置servlet
- java web.xml配置servlet
- java web.xml配置servlet
- Java web.xml配置 servlet
- web.xml配置Servlet
- servlet web.xml配置
- web.xml配置servlet
- web.xml 配置-servlet
- java Web.xml中servlet配置方法
- servlet在web.xml中的路径配置的映射
- eclipse项目web.xml文件配置servlet映射
- java web servlet配置
- servlet的web.xml配置
- Web.xml配置Servlet - Excerpts
- servlet 下配置web.xml
- web.xml之Servlet配置
- web.xml中配置servlet
- 一句话调整linux console中字体大小
- symbian qt 流媒体播放器
- 十进制整数区间[1, N]中数字1出现的个数
- Listing of the NT Native API functions
- Oracle序列
- Java Web 应用web.xml配置 --Servlet映射配置
- 安装VMWare7.1及双系统恢复为一个系统
- JS事件
- java.lang.IllegalStateException: getOutputStream() has already been call
- 数据库系统原理与应用:Oracle版
- 安装Colinux&Informix11.5&DBSonar过程详解-step by step
- 随机生成32位数,不重复
- 一篇关于web.xml配置的详细说明
- redhat 5 DNS 服务器的配置