1)what is IRule?
2)paramName="rule" is not declared
An example of passing a parameter (in this case id) to your Action Class
<result name="success" type="redirectAction">otherAction?id=${id}</result>
where otherAction Action Class accomodates parameter id by
private int id; //attribute declaration
public int getId() { return this.id; } //accessor
public void setId(int id) { this.id = id; } //mutator
Result params are typically used to locate a web resource such as
<param name="location">/ThankYou.jsp</param>
?
Martin
______________________________________________
Verzicht und Vertraulichkeitanmerkung / Note de déni et de confidentialité
Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger
sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung
oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem
Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung.
Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung
fuer den Inhalt uebernehmen.
Ce message est confidentiel et peut être privilégié. Si vous n'êtes pas le
destinataire prévu, nous te demandons avec bonté que pour satisfaire informez
l'expéditeur. N'importe quelle diffusion non autorisée ou la copie de ceci est
interdite. Ce message sert à l'information seulement et n'aura pas n'importe
quel effet légalement obligatoire. Étant donné que les email peuvent facilement
être sujets à la manipulation, nous ne pouvons accepter aucune responsabilité
pour le contenu fourni.
> Date: Tue, 7 Apr 2009 18:43:40 +0200
> Subject: Re: Error with ActionForward
> From: [email protected]
> To: [email protected]
>
> Does it actually fail, or does it just print the exception in the log?
> Do you have devMode on?
>
> Nils-H
>
> On Tue, Apr 7, 2009 at 6:08 PM, Security Management
> <[email protected]> wrote:
> > 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: [email protected]
> > For additional commands, e-mail: [email protected]
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
_________________________________________________________________
Rediscover Hotmail®: Get quick friend updates right in your inbox.
http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Updates1_042009