SpringMvc配置文件注意事项
来源:互联网 发布:vim c语言插件 编辑:程序博客网 时间:2024/05/22 12:09
<?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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
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.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
">
<!-- 扫描包(Controller|Service|Repository|Autowired|Component|Resource|...) -->
<context:component-scan base-package="com.wskj.spring"></context:component-scan>
<!-- 启用注解 -->
<mvc:annotation-driven></mvc:annotation-driven>
<mvc:resources location="/resource/" mapping="/static/**"></mvc:resources>
<!-- 文件上传解析器 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
p:maxUploadSize="34564356"
p:defaultEncoding="utf-8">
<!-- <property name="defaultEncoding" value="utf-8"></property> -->
</bean>
<!-- 视图解析器 -->
<bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/pages/" />
<!-- 后缀 -->
<property name="suffix" value=".jsp" />
</bean>
<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:aop="http://www.springframework.org/schema/aop"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:jee="http://www.springframework.org/schema/jee"
xmlns:tx="http://www.springframework.org/schema/tx"
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.2.xsd
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-4.2.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-4.2.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-4.2.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.2.xsd
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.2.xsd
">
<!-- 扫描包(Controller|Service|Repository|Autowired|Component|Resource|...) -->
<context:component-scan base-package="com.wskj.spring"></context:component-scan>
<!-- 启用注解 -->
<mvc:annotation-driven></mvc:annotation-driven>
<mvc:resources location="/resource/" mapping="/static/**"></mvc:resources>
<!-- 文件上传解析器 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
p:maxUploadSize="34564356"
p:defaultEncoding="utf-8">
<!-- <property name="defaultEncoding" value="utf-8"></property> -->
</bean>
<!-- 视图解析器 -->
<bean id="internalResourceViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- 前缀 -->
<property name="prefix" value="/WEB-INF/pages/" />
<!-- 后缀 -->
<property name="suffix" value=".jsp" />
</bean>
</beans>
对于springMvc 必须手动启动注解!默认是使用BeanNameUrlHandlerMapping方式
0 0
- SpringMvc配置文件注意事项
- springMVC配置文件部分简化的意义和注意事项
- SpringMVC配置文件
- SpringMVC配置文件
- springMvc配置文件
- SpringMVC配置文件
- SpringMVC配置文件
- springmvc配置文件
- springMVC配置文件
- SpringMVC 配置文件
- springmvc配置文件
- springMVC配置文件
- SpringMVC配置文件
- SpringMVC 配置文件
- springmvc 配置文件
- SpringMvc 配置文件
- springmvc配置文件
- SpringMVC 配置文件
- Linux(7) 常用命令扩展 改变用户环境变量 (可以实现登陆就执行shell脚本)
- 从实模式到保护模式
- POJ 1185 [NOI2001 D2T?] 炮兵阵地
- synchronized (class) 和synchronized (this)
- NHibernate之旅(19):初探SchemaExport工具使用
- SpringMvc配置文件注意事项
- JAVA总结
- Design Pattern: Builder Pattern(建造者模式)
- NHibernate之旅(20):再探SchemaExport工具使用
- 自动化测试框架介绍
- 自动化测试框架AutoTest
- linux内核驱动API指南(1)----驱动基础
- 工厂模式
- Sublime的Markdown插件:MarkDownEditing 和 OmniMarkupPreviewer