|
@@ -1,18 +1,26 @@
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?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-3.1.xsd
|
|
|
|
|
|
+<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"
|
|
|
|
+ xmlns:tx="http://www.springframework.org/schema/tx"
|
|
|
|
+ xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.1.xsd
|
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
|
|
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd">
|
|
|
|
|
|
+ http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd
|
|
|
|
+ http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd
|
|
|
|
+ http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd">
|
|
|
|
|
|
- <!-- 自动扫描且只扫描@Controller -->
|
|
|
|
- <context:component-scan base-package="com.xt.js.gkaq.web.ctl" use-default-filters="false">
|
|
|
|
- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" />
|
|
|
|
- </context:component-scan>
|
|
|
|
|
|
+ <!-- Enable annotation configuration -->
|
|
|
|
+ <context:annotation-config />
|
|
|
|
+ <!-- 自动扫描且只扫描@Controller -->
|
|
|
|
+ <context:component-scan base-package="com.xt.js.gkaq.web.ctl"
|
|
|
|
+ use-default-filters="false">
|
|
|
|
+ <context:include-filter type="annotation"
|
|
|
|
+ expression="org.springframework.stereotype.Controller" />
|
|
|
|
+ </context:component-scan>
|
|
|
|
|
|
- <mvc:annotation-driven >
|
|
|
|
- <mvc:message-converters>
|
|
|
|
- <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
|
|
|
|
|
|
+ <mvc:annotation-driven>
|
|
|
|
+ <mvc:message-converters>
|
|
|
|
+ <!-- 避免IE执行AJAX时,返回JSON出现下载文件 -->
|
|
<bean id="mappingJacksonHttpMessageConverter"
|
|
<bean id="mappingJacksonHttpMessageConverter"
|
|
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
|
class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
|
|
<property name="supportedMediaTypes">
|
|
<property name="supportedMediaTypes">
|
|
@@ -21,21 +29,36 @@
|
|
</list>
|
|
</list>
|
|
</property>
|
|
</property>
|
|
</bean>
|
|
</bean>
|
|
- </mvc:message-converters>
|
|
|
|
- </mvc:annotation-driven>
|
|
|
|
|
|
+ </mvc:message-converters>
|
|
|
|
+ </mvc:annotation-driven>
|
|
|
|
|
|
- <mvc:view-controller path="/" view-name="redirect:/index" />
|
|
|
|
|
|
+ <mvc:view-controller path="/" view-name="redirect:/index" />
|
|
|
|
|
|
- <mvc:resources mapping="/static/**" location="/static/" />
|
|
|
|
|
|
+ <mvc:resources mapping="/static/**" location="/static/" />
|
|
|
|
|
|
- <mvc:default-servlet-handler />
|
|
|
|
-
|
|
|
|
- <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
|
|
|
- <property name="prefix" value="/WEB-INF/view/" />
|
|
|
|
- <property name="suffix" value=".jsp" />
|
|
|
|
- </bean>
|
|
|
|
- <!-- AOP式方法级权限检查 -->
|
|
|
|
- <bean class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator" >
|
|
|
|
- <property name="proxyTargetClass" value="true" />
|
|
|
|
|
|
+ <mvc:default-servlet-handler />
|
|
|
|
+ <!-- 保证实现了Shiro内部lifecycle函数的bean执行 -->
|
|
|
|
+ <bean id="lifecycleBeanPostProcessor" class="org.apache.shiro.spring.LifecycleBeanPostProcessor" />
|
|
|
|
+ <bean
|
|
|
|
+ class="org.springframework.web.servlet.view.InternalResourceViewResolver">
|
|
|
|
+ <property name="prefix" value="/WEB-INF/view/" />
|
|
|
|
+ <property name="suffix" value=".jsp" />
|
|
|
|
+ </bean>
|
|
|
|
+ <!-- AOP式方法级权限检查 -->
|
|
|
|
+ <bean
|
|
|
|
+ class="org.springframework.aop.framework.autoproxy.DefaultAdvisorAutoProxyCreator">
|
|
|
|
+ <property name="proxyTargetClass" value="true" />
|
|
|
|
+ </bean>
|
|
|
|
+ <bean
|
|
|
|
+ class="org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor">
|
|
|
|
+ <property name="securityManager" ref="securityManager" />
|
|
|
|
+ </bean>
|
|
|
|
+ <bean class="com.xt.js.gkaq.web.system.ExceptionResolver">
|
|
|
|
+ <property name="exceptionMappings">
|
|
|
|
+ <props>
|
|
|
|
+ <prop key="org.apache.shiro.authz.UnauthorizedException">error/403</prop>
|
|
|
|
+ <prop key="java.lang.Exception">error/error</prop>
|
|
|
|
+ </props>
|
|
|
|
+ </property>
|
|
</bean>
|
|
</bean>
|
|
</beans>
|
|
</beans>
|