applicationContext.xml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:p="http://www.springframework.org/schema/p"
  5. xmlns:context="http://www.springframework.org/schema/context"
  6. xmlns:mvc="http://www.springframework.org/schema/mvc"
  7. xsi:schemaLocation="http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd
  8. http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  9. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
  10. <mvc:annotation-driven>
  11. <mvc:path-matching suffix-pattern="true" />
  12. </mvc:annotation-driven>
  13. <context:component-scan base-package="com.kingdee.eas.custom.integration" use-default-filters="true">
  14. <!-- <context:include-filter type="annotation" expression="org.springframework.stereotype.Controller" /> -->
  15. </context:component-scan>
  16. <context:component-scan base-package="com.kingdee" use-default-filters="false">
  17. <context:include-filter
  18. type="assignable"
  19. expression="com.kingdee.shr.guilogin.web.controller.MbosDownloadController"/>
  20. </context:component-scan>
  21. <!-- 静态资源映射 -->
  22. <mvc:resources mapping="/css/**" location="/" />
  23. <mvc:resources mapping="/views/**" location="/" />
  24. <mvc:resources mapping="/js/**" location="/" />
  25. <!-- 或者使用通配符统一映射(不推荐,会暴露所有静态资源) -->
  26. <!-- <mvc:resources mapping="/static/**" location="/" /> -->
  27. <!-- 视图解析器(只处理 JSP) -->
  28. <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
  29. <property name="prefix" value="/views/" />
  30. <property name="suffix" value=".jsp" />
  31. </bean>
  32. <!-- <bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver" -->
  33. <!-- 默认错误视图(当没有匹配的异常映射时使用) -->
  34. <!-- <property name="defaultErrorView" value="error"/> -->
  35. <!-- 将异常信息存入 Model 中的 key -->
  36. <!-- <property name="exceptionAttribute" value="exception"/> -->
  37. <!-- 定义异常类型与视图名称的映射 -->
  38. <!-- <property name="exceptionMappings"> -->
  39. <!-- <props> -->
  40. <!-- <prop key="java.lang.NullPointerException">error/nullPointer</prop> -->
  41. <!-- <prop key="java.lang.IllegalArgumentException">error/illegalArg</prop> -->
  42. <!-- <prop key="com.kingdee.shr.base.syssetting.exception.BusinessException">error/business</prop> -->
  43. <!-- 可以添加更多自定义异常 -->
  44. <!-- <prop key="java.lang.Exception">error/error</prop> -->
  45. <!-- </props> -->
  46. <!-- </property> -->
  47. <!-- 可选:记录异常日志 -->
  48. <!-- <property name="warnLogCategory" value="com.kingdee.exception"/> -->
  49. <!-- </bean> -->
  50. </beans>