首页 > 代码库 > springmvc-servlet.xml web.xml文件中servlet param-value 指向的文件
springmvc-servlet.xml web.xml文件中servlet param-value 指向的文件
<?xml version="1.0" encoding="UTF-8" ?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd">
<!--开启Springmvc注解驱动 -->
<mvc:annotation-driven />
<!--开启自动扫描Bean -->
<context:component-scan base-package="com.lovo" />
<!--配置页面控制器映射 -->
<bean class="org.springframework.web.servlet.handler.BeanNameUrlHandlerMapping" />
<!--页面控制器适配器 -->
<bean class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter" />
<!--配置视图解析器 -->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="viewClass"
value="http://www.mamicode.com/org.springframework.web.servlet.view.JstlView" />
<property name="prefix" value="" />
<property name="suffix" value="http://www.mamicode.com/.jsp" />
</bean>
<!-- 配置自定义拦截器 -->
<mvc:interceptors>
<bean class="com.lovo.interceptor.MyHandleInterceptor"/>
<!-- 添加其他拦截器 -->
</mvc:interceptors>
<!-- 配置文件上传 -->
<bean id="multipartResolver"
class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
<!-- 设置上传文件字符集编码 -->
<property name="defaultEncoding" value="http://www.mamicode.com/utf-8"></property>
<!-- 设置上传文件最大限制 -->
<property name="maxUploadSize" value="http://www.mamicode.com/10485760000"></property>
<!-- 设置上传文件最大缓存 -->
<property name="maxInMemorySize" value="http://www.mamicode.com/40960"></property>
</bean>
<!--配置访问静态资源 -->
<mvc:default-servlet-handler />
</beans>
springmvc-servlet.xml web.xml文件中servlet param-value 指向的文件