Setting Parameters in xwork.xml in "chain" or "redirect-action" resulttypes

Greg Pelly <[email protected]> Fri, 15 Dec 2006 15:36:40 CST
Newsgroups gmane.comp.java.open-symphony.webwork
Message-ID <13688136.1166218660084.JavaMail.os-j2ee@opensymphony01.managed.contegix.com>
I am attempting to pass a status message from one action to another using the "alert" variable shown in the xwork.xml below. 

[code]
        <action name="buy" class="MyAction">
          <result type="chain" name="success">
            <param name="actionName">home</param>
            <param name="alert">Operation Successful</param>
          </result>
        </action>
[/code]

When I do so my Action correctly passes the values, but I get a stacktrace:

[code]
13:01:08,669  WARN OgnlUtil:370 - Caught OgnlException while setting property 'alert' on type 'com.opensymphony.xwork.ActionChainResult'.
ognl.NoSuchPropertyException: com.opensymphony.xwork.ActionChainResult.alert
	at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:133)
	at com.opensymphony.xwork.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:64)
	at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1629)
	at ognl.ASTProperty.setValueBody(ASTProperty.java:105)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
	at ognl.SimpleNode.setValue(SimpleNode.java:246)
	at ognl.Ognl.setValue(Ognl.java:476)
...
[/code]

I have tried using "redirect-action" instead of "chain" with the same results, just a different error:
[code]
OgnlUtil:370 - Caught OgnlException while setting property 'alert' on type 'com.opensymphony.webwork.dispatcher.ServletActionRedirectResult'.
[/code]

I understand it appears to be calling ServletActionRedirect.setAlert() and is complaining that it can't find it. Am I using this improperly?

Thanks
Greg
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.opensymphony.com/thread.jspa?threadID=53802&messageID=108040#108040

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]