标签:app inf except multi control instance property web 注解
<?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:mvc="http://www.springframework.org/schema/mvc"
xmlns:context="http://www.springframework.org/schema/context"
xsi:schemaLocation="
http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- 通过bean的name,完成url映射 -->
<!-- <bean name="/springMVC.html" class="cn.bdqn.controller.HelloController"/> -->
<!--使用annotation方式,完成映射-->
<!--让spring扫描包下的所有的类,让标注spring注解的类生效 -->
<context:component-scan base-package="cn.bdqn.controller"></context:component-scan>
<!-- 开启注解 -->
<mvc:annotation-driven/>
<!-- 视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/jsp/"/>
<property name="suffix" value=".jsp"/>
</bean>
<!-- 全局异常 -->
<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
<property name="exceptionMappings">
<props>
<prop key="cn.bdqn.bean.UserException">error</prop>
</props>
</property>
</bean>
<!--配置静态文件访问springMVC中无法访问静态文件,需要映射成URL路径进行访问 -->
<mvc:resources location="/statics/" mapping="/statics/**"/>
<!--配置文件上传 MultiPartResovler -->
<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<property name="maxUploadSize" value="1000000"/>
</bean>
</beans>
标签:app inf except multi control instance property web 注解
原文地址:http://www.cnblogs.com/Interface123/p/7291382.html