Spring-MVC框架下对web.xml文件及spring_mvc.xml文件内容的释义资料整理
2017-03-01 23:22
621 查看
初学Spring,对各种配置语句的作用知之甚少,有幸浏览诸位技术大牛的分享,让我获益良多,特将所搜集资料汇总,供大家参考,共同进步。
web.xml
1.web.xml中< context-param> < /context-param>,< listener>< /listener>的作用过程
转自http://blog.csdn.net/jubincn/article/details/9115205
2..web.xml中< filter>< /filter>,< filter-mapping>< /filter-mapping>的作用过程
转自http://www.cnblogs.com/wjqblogs/p/4226655.html?utm_source=tuicool&utm_medium=referral
3.web.xml中< servlet>< /servlet>< servlet-mapping>< /servlet-mapping>
< servlet-name> 这个是我们要注册servlet的名字,一般跟Servlet类名有关
< servlet-class> 这个就是指向我们要注册的servlet 的类地址, 要带包路径以上两个包在一个servlet 节点之下.
< servlet-mapping> 是用来配置我们注册的组件的访问路径,里面包括两个节点一个是 < servlet-name> 这个要与 前面写的servlet一致另一个是 < url-pattern> 配置这个组件的访问路径
转自http://blog.csdn.net/hello5orld/article/details/9407905
4.< url-pattern>匹配规则
转自http://www.cnblogs.com/canger/p/6084846.html
转自http://blog.csdn.net/u012679583/article/details/52816257
spring_mvc.xml
1.< context:component-scan base-package=”“>< /context:component-scan>的作用过程以及< mvc:annotation-driven/>必不可少的原因
转自http://blog.csdn.net/jbgtwang/article/details/7359592
转自http://blog.csdn.net/lf_software_studio/article/details/8256510
spring.xml
1.Spring-MVC处理静态资源的方式
转自http://www.cnblogs.com/fangqi/archive/2012/10/28/2743108.html
转自http://blog.csdn.net/qq_16465949/article/details/51907503
web.xml
<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:web="http://xmlns.jcp.org/xml/ns/javaee" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <display-name>Archetype Created Web Application</display-name> < 4000 context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring.xml,classpath:spring_validate.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <filter> <filter-name>CharacterEncodingFilter</filter-name> <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>utf-8</param-value> </init-param> </filter> <filter-mapping> <filter-name>CharacterEncodingFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>SpringMVC4</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring_mvc.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>SpringMVC4</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping> </web-app>
1.web.xml中< context-param> < /context-param>,< listener>< /listener>的作用过程
转自http://blog.csdn.net/jubincn/article/details/9115205
2..web.xml中< filter>< /filter>,< filter-mapping>< /filter-mapping>的作用过程
转自http://www.cnblogs.com/wjqblogs/p/4226655.html?utm_source=tuicool&utm_medium=referral
3.web.xml中< servlet>< /servlet>< servlet-mapping>< /servlet-mapping>
< servlet-name> 这个是我们要注册servlet的名字,一般跟Servlet类名有关
< servlet-class> 这个就是指向我们要注册的servlet 的类地址, 要带包路径以上两个包在一个servlet 节点之下.
< servlet-mapping> 是用来配置我们注册的组件的访问路径,里面包括两个节点一个是 < servlet-name> 这个要与 前面写的servlet一致另一个是 < url-pattern> 配置这个组件的访问路径
转自http://blog.csdn.net/hello5orld/article/details/9407905
4.< url-pattern>匹配规则
转自http://www.cnblogs.com/canger/p/6084846.html
转自http://blog.csdn.net/u012679583/article/details/52816257
spring_mvc.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd "> <context:component-scan base-package="com.li.controller"></context:component-scan> <mvc:annotation-driven/> <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" /> <property name="prefix" value="/WEB-INF/jsp/" /> <property name="suffix" value=".jsp" /> </bean> </beans>
1.< context:component-scan base-package=”“>< /context:component-scan>的作用过程以及< mvc:annotation-driven/>必不可少的原因
转自http://blog.csdn.net/jbgtwang/article/details/7359592
转自http://blog.csdn.net/lf_software_studio/article/details/8256510
spring.xml
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.0.xsd http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd"> <mvc:default-servlet-handler/> </beans>
1.Spring-MVC处理静态资源的方式
转自http://www.cnblogs.com/fangqi/archive/2012/10/28/2743108.html
转自http://blog.csdn.net/qq_16465949/article/details/51907503
相关文章推荐
- springMVC+Mybatis的maven-web项目的pom.xml文件内容
- Spring Web MVC框架(九) XML和JSON视图与内容协商
- spring-mvc-mybatis web.xml文件
- maven项目中 springMVC pom.xml文件内容
- SSM(spring-springmvc-mybatis)整合开发xml配置文件内容springmvc-config.xml,application.xml,web.xml
- maven新建Spring MVC + MyBatis + Oracle的Web项目中pom.xml文件
- spring-mvc-mybatis web子目录xml文件
- 这两天整理springmvc+jpa+vaadin整理好了。现在吧pom.xml和一些配置文件发出来。
- SpringMVC+idea中web.xml文件的The content of element type "web-app" must match问题
- [整理]WebUploader + SpringMVC 实现多文件断点续传之二 多文件断点续传
- spring+springmvc+druid+oscache+mybatis整合web.xml 配置内容
- SpringMVC(1):基础配置文件web.xml 和 <servlet-name>-servlet.xml / springmvc.xml
- 基于IntelliJ IDEA上创建Maven Spring MVC项目web.xml文件解读
- [整理]WebUploader + SpringMVC 实现多文件断点续传之一 多文件上传
- 第2.1.5章 WEB系统最佳实践Spring文件配置之spring-mvc.xml
- shh整合后web.xml、spring配置文件和struts.xml的内容
- shh整合后web.xml、spring配置文件和struts.xml的内容
- spring配置文件路径修改后web.xml配置
- spring applicationContext.xml web.xml springmvc-servlet.xml
- web.xml集成Spring,Struts配置文件说明