My mistake, I was thinking of a similar problem where I needed to pass a static param to the next action being invoked. In this case, the parameter had to be declared in the result stanza, but was not intended for the result type. We also didn't want it to be noise on the action. In this case there was no clear context.

/Ian

--
Ian Roughley
From Down & Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:
Actually when OGNL fails to locate a setXXX(String) on the result when
encountering result parm"${width} " it fails with

 2008-02-15 09:17:25,991ERROR [http-8080-2] (
DefaultActionInvocation.java:createResult:198) - There was an exception
while instantiating the result of type
org.apache.struts2.dispatcher.ChartResult
 2008-02-15 09:17:26,241Caught OgnlException while setting property 'height'
on type 'org.apache.struts2.dispatcher.ChartResult'. - Class:
ognl.OgnlRuntime

and the action setter is never invoked. What would the value of recovery by
setting a result parameter on the action be?  As far as differentiating
between parameters in the config file goes, why wouldn't the lexical context
of the parameter determine the intended application of the value?





On Fri, Feb 15, 2008 at 9:00 AM, Ian Roughley <[EMAIL PROTECTED]> wrote:

I think you'll find this happens will all the result types and not just
the chart result.  If you have additional info in the result config as
parameters, it will try to set is on the result type, fail with an
exception, and then set it correctly on the action.

As to a resolution... as both result types and action can take
parameters from the config, what is the best way to differentiate them
without making the config more complicated?

/Ian

--
Ian Roughley
From Down & Around, Inc.
Consulting * Training / Mentoring * Agile Process * Open Source
web: http://www.fdar.com - email: [EMAIL PROTECTED]



[EMAIL PROTECTED] wrote:
I understand the quirky plug-in, but that does not explain why OGNL is
looking for a setHeight(String) on ChartResult!  If I hardcode ints into
these two parms, life is good.  I am puzzled at why S2 is not executing
getHeight() on my ChartAction and substituting the height and weight
into
these params.

Can you look at this
<http://struts.apache.org/2.x/docs/result-configuration.html>and tell me
how
the two differ?

Peace,
Scott

On Thu, Feb 14, 2008 at 3:35 PM, Dave Newton <[EMAIL PROTECTED]>
wrote:
--- [EMAIL PROTECTED] wrote:

Anyone realize why this is not working?  I have get/set methods in my
ChartAction, but the getters are not fetching the values for the
Result.
        <action name="chart" class="actions.ChartAction">
            <result type="chart">
                <param name="height">${height}</param>
                <param name="width">${width}</param>
            </result>
        </action>

Probably because the "chart" result doesn't parse its parameters.

Dave


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







Reply via email to