applicationMVC.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:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"

xsi:schemaLocation="
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-4.3.xsd

http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-4.3.xsd

http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-4.3.xsd

http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-4.3.xsd
">
<!--扫描bean-->
<context:component-scan base-package="com.lbnl"/>
<mvc:annotation-driven/>
<!-- 前后最-->
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<!-- prefix 前缀 设置后台return-->
<property name="prefix" value="/WEB-INF/jsp/"/>
<!-- suffix 后缀-->
<property name="suffix" value=".jsp"/>
</bean>

<!-- 放行静态资源-->
<mvc:resources mapping="/static/**" location="/static/"/>

<!-- 解决中文乱码-->
<mvc:annotation-driven>
<mvc:message-converters>
<!-- <bean class="org.springframework.http.converter.json.MappingJacksonHttpMessageConverter"/>-->
<bean class="org.springframework.http.converter.StringHttpMessageConverter">
<property name="supportedMediaTypes">
<list>
<value>text/plain;charset=utf-8</value>
<value>text/html;charset=UTF-8</value>
</list>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>
<import resource="springShiro.xml"/>

</beans>
posted @ 2022-08-15 13:37  java小寇  阅读(50)  评论(0)    收藏  举报