gpt4 book ai didi

struts2 - 如何修复重定向 OGNL 错误,无法设置参数?

转载 作者:行者123 更新时间:2023-12-01 13:35:49 27 4
gpt4 key购买 nike

我不确定这是我的问题还是这是一个错误。

出现以下错误

11:52:01,623 ERROR ObjectFactory:27 - Unable to set parameter [dest] in result of type [org.apache.struts2.dispatcher.ServletRedirectResult]
Caught OgnlException while setting property 'dest' on type 'org.apache.struts2.dispatcher.ServletRedirectResult'. - Class: ognl.ObjectPropertyAccessor
File: ObjectPropertyAccessor.java
Method: setProperty
Line: 132 - ognl/ObjectPropertyAccessor.java:132:-1
at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:392)

我的配置非常简单

<package name="esupport" namespace="/esupport" extends="struts-default">
<action name="old-esupport" class="com.my.MyRedirectAction">
<result type="redirect">
<param name="location">http://some.server.com/init.asp</param>
<param name="dest">${dest}</param>
</result>
</action>
</package>

我的类有一对 get/set 方法。就是这样。没什么好看的

我找到了 this论坛中的线程。但这并没有解决我的问题

我正在使用

Struts 2.1.16 Spring 2Spring Security + CAS

(有趣的是它在错误后将我发送到 CAS 服务器,但我想它会在重定向问题得到修复后得到纠正)

最佳答案

这似乎是 Struts2 的一个错误。他们建议...通过以下方式隐藏错误:

<category name="com.opensymphony.xwork2.ObjectFactory">
<priority value="fatal"/>
</category>

来自.... TroubleShooting guide section on redirects

关于struts2 - 如何修复重定向 OGNL 错误,无法设置参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/848828/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com