resources/springmvc.xml

(完整代码) 1KB

<?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:context="http://www.springframework.org/schema/context"
	xmlns:mvc="http://www.springframework.org/schema/mvc"
	xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
		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">

	<!-- 扫描controller -->
	<context:component-scan
		base-package="com.sxt.sys.controller"></context:component-scan>
	<context:component-scan
		base-package="com.sxt.bus.controller"></context:component-scan>
	<context:component-scan
		base-package="com.sxt.stat.controller"></context:component-scan>

	<!-- 配置映射器和适配器 -->
	<mvc:annotation-driven></mvc:annotation-driven>

	<!-- 配置前视图解析器 -->
	<bean
		class="org.springframework.web.servlet.view.InternalResourceViewResolver">
		<!-- 注入前后缀 -->
		<property name="prefix" value="/WEB-INF/view/"></property>
		<property name="suffix" value=".jsp"></property>
	</bean>

	<!-- 配置springmvc对文件上传的支持 -->
	<bean id="multipartResolver"
		class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
		<!-- 设置文件名的编码 -->
		<property name="defaultEncoding" value="utf-8"></property>
		<!-- 配置最上传文件的支持 20M -->
		<property name="maxUploadSize" value="20971520"></property>
		<!-- 设置文件上传的临时目录 -->
		<property name="uploadTempDir" value="upload/temp" />
	</bean>


	<!-- 配置静态文件放行 -->
	<mvc:default-servlet-handler />

</beans>

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。