SpringMVC之web.xml基本配置
来源:互联网 发布:语音识别算法 编辑:程序博客网 时间:2024/06/11 12:27
web.xml文件的作用:
1.指定webapp的名称
<display-name>SpringMVCDemo</display-name>
2.初始化上下文参数,装载spring配置
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext.xml</param-value>
</context-param>
解释:
<param-name></param-name>指定上下文名称contextConfigLocation。
contextConfigLocation作用:指定要加载的的spring文件
<param-value></param-value> spring配置文件的路径,如果多个配置文件可以用逗号分隔。
配置spring监听器
<listener>
<listener-class>org.springframeword.web.context.ContextLoaderListener</listener-class>
</listener>
3.注册Dispatecher-Servlet,load-on-startup标示是否在启动时候就加在servlet,加载优先级
<servlet>
<servlet-name>appServlet</servlet-name>
<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-calss>
<load-on-startup>1</load-on-startup>
</servlet>
将DispatcherServlet映射到“/”,拦截所有请求
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>/</url-pattern>
</setvlet-mapping>
- SpringMVC之web.xml基本配置
- springmvc之web.xml配置
- springmvc 项目:web.xml基本配置
- SpringMVC环境配置之web.xml
- SpringMVC web.xml配置
- SpringMVC web.xml配置
- web.xml基本配置
- web.xml基本配置
- web.xml基本配置
- springMVC+mybatis整合之applicationContext.xml基本配置详解
- springMVC+mybatis整合之applicationContext.xml基本配置详解
- springmvc基本web.xml配置和xxxx-sevlet.xml配置简介
- web.xml配置,基于SpringMVC
- SpringMVC的web.xml配置
- SpringMVC之web.xml,了解必要配置项
- springmvc web.xml spring-servlet.xml 配置
- SpringMVC之web.xml解读
- Springmvc Web.xml的基本说明
- 在ASP.NET中进行MD5加密。
- 运行第一个python简单hello world脚本
- 大学生活有哪十大禁忌?
- KMP算法理解笔记
- DSP平台运营遇到的问题
- SpringMVC之web.xml基本配置
- Java项目命名规范(简洁版)——让自己专业点
- 服务器上使用python
- Java基础总结
- Ubuntu 手动连接 SSH
- exit与return区别
- 我為什麼鼓勵工程師寫 blog
- String(byte[] bytes, Charset charset) 和 getBytes() 使用
- nohup &