we3epar/target/classes/struts.xml
2026-03-12 09:39:36 +08:00

73 lines
3.3 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 2.5//EN" "http://struts.apache.org/dtds/struts-2.5.dtd">
<struts>
<!-- 指定由spring负责action对象的创建 -->
<constant name="struts.objectFactory" value="spring" />
<!-- 所有匹配*.action的请求都由struts2处理 -->
<constant name="struts.action.extension" value="action,do" />
<!-- 是否启用开发模式 -->
<constant name="struts.devMode" value="false" />
<!-- struts配置文件改动后是否重新加载 -->
<constant name="struts.configuration.xml.reload" value="true" />
<!-- 设置浏览器是否缓存静态内容 -->
<constant name="struts.serve.static.browserCache" value="false" />
<!-- 请求参数的编码方式 -->
<constant name="struts.i18n.encoding" value="utf-8" />
<!-- 每次HTTP请求系统都重新加载资源文件有助于开发 -->
<constant name="struts.i18n.reload" value="true" />
<!-- 文件上传最大值 -->
<constant name="struts.multipart.maxSize" value="104857600" />
<!-- 让struts2支持动态方法调用 -->
<constant name="struts.enable.DynamicMethodInvocation" value="true" />
<!-- Action名称中是否还是用斜线 -->
<constant name="struts.enable.SlashesInActionNames" value="false" />
<!-- 允许标签中使用表达式语法 -->
<constant name="struts.tag.altSyntax" value="true" />
<!-- 对于WebLogic,Orion,OC4J此属性应该设置成true -->
<constant name="struts.dispatcher.parametersWorkaround" value="true" />
<!--7.0.0中参数setting要加注解放开-->
<constant name="struts.parameters.requireAnnotations" value="false" />
<constant name="struts.ognl.allowStaticFieldAccess" value="true" />
<constant name="struts.ognl.disallowCustomOgnlMap" value="false" />
<constant name="struts.disallowProxyObjectAccess" value="false" />
<constant name="struts.allowlist.enable" value="false" />
<constant name="struts.mapper.alwaysSelectFullNamespace" value="false" />
<constant name="struts.actionConfig.fallbackToEmptyNamespace" value="true" />
<!-- <constant name="struts.ui.escapeHtmlBody" value="true" />-->
<!-- <include file="./struts-owndefault.xml"/>-->
<package name="default" namespace="/" extends="json-default">
<!--6版本后 默认加了csp拦截器 coep coop 拦截器,需要关了不然页面要遵循csp-->
<interceptors>
<interceptor-stack name="parentStack">
<interceptor-ref name="defaultStack">
<param name="csp.disabled">true</param>
<param name="coep.disabled">true</param>
<param name="coop.disabled">true</param>
</interceptor-ref>
</interceptor-stack>
</interceptors>
<default-interceptor-ref name="parentStack"/>
<!--2.5版本之后 动态调用方法除了开启之外,还要加下面这个-->
<global-allowed-methods>regex:.*</global-allowed-methods>
<action name="*" class="{1}">
<result name="success">${nextAction}</result>
<result name="error">error/error.jsp</result>
<result name="error404">error/404.jsp</result>
<result name="binding">error/binding.jsp</result>
<result name="bindingDing">error/bindingDing.jsp</result>
<result name="redirect" type="redirectAction">${nextAction}</result>
<result name="successJSON" type="json">
<param name="defaultEncoding">utf-8</param>
</result>
</action>
</package>
</struts>