Struts 2.1.6, here's my action.

<action name="saveRuleName" class="com.secmgmt.actions.SaveRule">
        <result name="success" type="redirectAction">
                <param name="actionName">addExceptionForm</param>
                <param name="rule">${rule}</param>
        </result>
</action>

public class AddExceptionForm extends SMCBaseAction
{

private IRule rule;

public IRule getRule()
        {
            return rule;
        }

    public void setRule(IRule r)
        {
            this.rule = r;
        }

public String execute()
        {
            return SUCCESS;
        }
}

This gives the following exception, even though it seems to generate the
proper URL:


2009-04-07 12:03:06,965 [http-8080-Processor23] ERROR
com.opensymphony.xwork2.ObjectFactory - Unable to set parameter [rule] in
result of type [org.apache.struts2.dispatcher.ServletActionRedirectResult]
Caught OgnlException while setting property 'rule' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'. - Class:
ognl.ObjectPropertyAccessor
File: ObjectPropertyAccessor.java
Method: setProperty
Line: 163 - ognl/ObjectPropertyAccessor.java:163:-1
        at
com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:392)
        at
com.opensymphony.xwork2.ognl.OgnlUtil.setProperty(OgnlUtil.java:143)
        at
com.opensymphony.xwork2.ognl.OgnlReflectionProvider.setProperty(OgnlReflecti
onProvider.java:91)
        at
com.opensymphony.xwork2.ObjectFactory.buildResult(ObjectFactory.java:221)
        at
com.opensymphony.xwork2.DefaultActionInvocation.createResult(DefaultActionIn
vocation.java:208)
        at
com.opensymphony.xwork2.DefaultActionInvocation.executeResult(DefaultActionI
nvocation.java:355)
        at
com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocati
on.java:265)


and so on, then this:

Caused by: ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.rule
        at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:163)
        at
com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAcces
sor.java:28)
        at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1950)
        at ognl.ASTProperty.setValueBody(ASTProperty.java:122)
        at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:210)
        at ognl.SimpleNode.setValue(SimpleNode.java:289)
        at ognl.Ognl.setValue(Ognl.java:737)
        at com.opensymphony.xwork2.ognl.OgnlUtil.setValue(OgnlUtil.java:192)
        at
com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:385)
        ... 88 more

This is not in agreement with the documentation, I don't think, which says
this (in the javadocs).   As far as I can tell, that's exactly what I am
doing:

<action name="gatherReportInfo" class="...">
       <result name="showReportResult" type="redirectAction">
          <param name="actionName">generateReport</param>
          <param name="namespace">/genReport</param>
          <param name="reportType">pie</param>
          <param name="width">100</param>
          <param name="height">100</param>
          <param name="empty"></param>
          <param name="supressEmptyParameters">true</param>
       </result>
</action>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscr...@struts.apache.org
For additional commands, e-mail: user-h...@struts.apache.org

Reply via email to