struts.xml 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
  3. "http://struts.apache.org/dtds/struts-2.1.7.dtd">
  4. <struts>
  5. <constant name="struts.devMode" value="false"></constant>
  6. <constant name="struts.objectFactory" value="spring"></constant>
  7. <constant name="struts.locale" value="zh_CN"></constant>
  8. <constant name="struts.i18n.encoding" value="utf-8"></constant>
  9. <constant name="struts.ui.theme" value="simple"></constant>
  10. <constant name="struts.custom.i18n.resources" value="globalMessages"></constant>
  11. <constant name="struts.multipart.maxSize" value="20971520" />
  12. <constant name="struts.convention.result.path" value="/pages/" />
  13. <constant name="struts.convention.classes.reload" value="true" />
  14. <constant name="struts.convention.default.parent.package"
  15. value="jeeweb-default" />
  16. <package name="jeeweb-default" extends="convention-default">
  17. <result-types>
  18. <result-type name="json"
  19. class="com.hcks.cmfds.core.web.PlainStringResult"></result-type>
  20. </result-types>
  21. <interceptors>
  22. <interceptor class="com.hcks.cmfds.core.security.AuthenticationInterceptor"
  23. name="authenticate" />
  24. <interceptor-stack name="defaultStack">
  25. <!-- <interceptor-ref name="exception" />
  26. <interceptor-ref name="servletConfig" />
  27. <interceptor-ref name="authenticate" />
  28. <interceptor-ref name="checkbox" />
  29. <interceptor-ref name="params">
  30. <param name="excludeParams">.*\\u0023.*</param>
  31. </interceptor-ref>
  32. <interceptor-ref name="conversionError" />
  33. <interceptor-ref name="chain" />
  34. <interceptor-ref name="validation">
  35. <param name="excludeMethods">input,back,cancel,browse,load,list</param>
  36. </interceptor-ref>
  37. <interceptor-ref name="workflow">
  38. <param name="excludeMethods">input,back,cancel,browse,load,list</param>
  39. </interceptor-ref>
  40. -->
  41. <interceptor-ref name="exception" />
  42. <interceptor-ref name="alias" />
  43. <interceptor-ref name="servletConfig" />
  44. <interceptor-ref name="prepare" />
  45. <interceptor-ref name="i18n" />
  46. <interceptor-ref name="chain" />
  47. <interceptor-ref name="debugging" />
  48. <interceptor-ref name="profiling" />
  49. <interceptor-ref name="scopedModelDriven" />
  50. <interceptor-ref name="modelDriven" />
  51. <interceptor-ref name="fileUpload" />
  52. <interceptor-ref name="checkbox" />
  53. <interceptor-ref name="staticParams" />
  54. <interceptor-ref name="params"/>
  55. </interceptor-stack>
  56. <interceptor-stack name="fileUploadStack">
  57. <interceptor-ref name="fileUpload" />
  58. <interceptor-ref name="defaultStack" />
  59. </interceptor-stack>
  60. <interceptor-stack name="tokenStack">
  61. <interceptor-ref name="token" />
  62. <interceptor-ref name="defaultStack" />
  63. </interceptor-stack>
  64. <interceptor-stack name="uploadStack">
  65. <interceptor-ref name="fileUpload">
  66. <param name="maximumSize">20971520</param> <!-- 20M=20*1024*1024 byte -->
  67. </interceptor-ref>
  68. </interceptor-stack>
  69. </interceptors>
  70. <global-results>
  71. <result name="errorHandler" type="chain">
  72. <param name="actionName">error</param>
  73. <param name="namespace">/</param>
  74. </result>
  75. <result name="loginpage" type="redirect">/loginpage.action${#request.returnURL}
  76. </result>
  77. </global-results>
  78. <global-exception-mappings>
  79. <exception-mapping
  80. exception="com.hcks.cmfds.core.security.AuthenticationException"
  81. result="invalid.permission" />
  82. <exception-mapping exception="java.lang.Throwable"
  83. result="errorHandler" />
  84. </global-exception-mappings>
  85. </package>
  86. </struts>