You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by holod <se...@gmail.com> on 2008/12/02 10:19:55 UTC

Problem when using result type="redirect-action"

When I try to redirect action and set parameter value to it, I get an
exception:

[02.12.08 12:11:33:705 MSK] 00000031 OgnlUtil      W
com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
OgnlException while setting property 'page' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
                                 ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.page
	at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
	at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlValueStack.java:81)
	at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
	at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
	at ognl.SimpleNode.setValue(SimpleNode.java:246)
	at ognl.Ognl.setValue(Ognl.java:476)
	at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
	at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
	at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
	at com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


my struts.xml:

<action name="ViewTestedLetters" class="admin.AdminViewTreatmentAction"
method="viewTested">
	        <result name="success" >/admin/treatmentadm.jsp</result>
</action>

<action name="ApproveLetters" class="admin.AdminEditTreatmentAction"
method="approve">
	        <result name="*" type="redirect-action">
		         ViewTestedLetters
	         	 /admin
	         	 1
	         </result>
</action>

These two action classes have field:
private int page;

These two action classes have getter and setter for the field named page:
public void setPage(int page) {
	this.page = page;
}

public int getPage() {
	return page;
}

Why does I get such exception?


P.S.
I've used this tutorial:
http://struts.apache.org/2.x/docs/redirect-action-result.html


-- 
View this message in context: http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22-tp20788608p20788608.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Problem when using result type="redirect-action"

Posted by holod <se...@gmail.com>.


KE LI-2 wrote:
> 
>> I think some thing is wrong at these lines,
>>
>> <result name="*" type="redirect-action">
>>                         ViewTestedLetters
>>                         /admin
>>                         1
>>                 </result> 
> 
> 

Nabble swallowed my tags, I've replaced them on [ and ]
<result name="*" means any result name, it doesn't matter which one.


-- 
View this message in context: http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22-tp20788608p20788945.html
Sent from the Struts - User mailing list archive at Nabble.com.


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


Re: Problem when using result type="redirect-action"

Posted by KE LI <hk...@gmail.com>.
admin{1}

2008/12/2 ravindra <ra...@btpsoft.com>

> I think some thing is wrong at these lines,
>
> <result name="*" type="redirect-action">
>                         ViewTestedLetters
>                         /admin
>                         1
>                 </result>
>
> Your mapping should be like,
> <result name="*" type="redirect-action">ViewTestedLetters</result>
>
> All the best,
>
> -----Original Message-----
> From: holod [mailto:serega.sheypak@gmail.com]
> Sent: Tuesday, December 02, 2008 2:50 PM
> To: user@struts.apache.org
> Subject: Problem when using result type="redirect-action"
>
>
> When I try to redirect action and set parameter value to it, I get an
> exception:
>
> [02.12.08 12:11:33:705 MSK] 00000031 OgnlUtil      W
> com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
> OgnlException while setting property 'page' on type
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
>                                 ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.page
>        at
> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
>        at
>
> com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
> alueStack.java:81)
>        at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
>        at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
>        at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
>        at ognl.SimpleNode.setValue(SimpleNode.java:246)
>        at ognl.Ognl.setValue(Ognl.java:476)
>        at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
>        at
>
> com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
>        at
> com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
>        at
> com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)
>
>
> my struts.xml:
>
> <action name="ViewTestedLetters" class="admin.AdminViewTreatmentAction"
> method="viewTested">
>                <result name="success" >/admin/treatmentadm.jsp</result>
> </action>
>
> <action name="ApproveLetters" class="admin.AdminEditTreatmentAction"
> method="approve">
>                <result name="*" type="redirect-action">
>                         ViewTestedLetters
>                         /admin
>                         1
>                 </result>
> </action>
>
> These two action classes have field:
> private int page;
>
> These two action classes have getter and setter for the field named page:
> public void setPage(int page) {
>        this.page = page;
> }
>
> public int getPage() {
>        return page;
> }
>
> Why does I get such exception?
>
>
> P.S.
> I've used this tutorial:
> http://struts.apache.org/2.x/docs/redirect-action-result.html
>
>
> --
> View this message in context:
>
> http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22
> -tp20788608p20788608.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
Best Regards,
Licco

Re: Problem when using result type="redirect-action"

Posted by Adam Hardy <ah...@cyberspaceroad.com>.
It's a feature! If you look below the stacktrace, you'll see it is logged as a 
warning. Nothing is actually wrong - it is a struts internal quirk.

ravindra on 02/12/08 09:25, wrote:
> I think some thing is wrong at these lines,
> 
> <result name="*" type="redirect-action">
> 		         ViewTestedLetters
> 	         	 /admin
> 	         	 1
> 	         </result>
> 
> Your mapping should be like,
> <result name="*" type="redirect-action">ViewTestedLetters</result>
> 
> All the best,
> 
> -----Original Message-----
> From: holod [mailto:serega.sheypak@gmail.com] 
> Sent: Tuesday, December 02, 2008 2:50 PM
> To: user@struts.apache.org
> Subject: Problem when using result type="redirect-action"
> 
> 
> When I try to redirect action and set parameter value to it, I get an
> exception:
> 
> [02.12.08 12:11:33:705 MSK] 00000031 OgnlUtil      W
> com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
> OgnlException while setting property 'page' on type
> 'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
>                                  ognl.NoSuchPropertyException:
> org.apache.struts2.dispatcher.ServletActionRedirectResult.page
> 	at
> ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
> 	at
> com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
> alueStack.java:81)
> 	at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
> 	at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
> 	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
> 	at ognl.SimpleNode.setValue(SimpleNode.java:246)
> 	at ognl.Ognl.setValue(Ognl.java:476)
> 	at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
> 	at
> com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
> 	at
> com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
> 	at
> com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)
> 
> 
> my struts.xml:
> 
> <action name="ViewTestedLetters" class="admin.AdminViewTreatmentAction"
> method="viewTested">
> 	        <result name="success" >/admin/treatmentadm.jsp</result>
> </action>
> 
> <action name="ApproveLetters" class="admin.AdminEditTreatmentAction"
> method="approve">
> 	        <result name="*" type="redirect-action">
> 		         ViewTestedLetters
> 	         	 /admin
> 	         	 1
> 	         </result>
> </action>
> 
> These two action classes have field:
> private int page;
> 
> These two action classes have getter and setter for the field named page:
> public void setPage(int page) {
> 	this.page = page;
> }
> 
> public int getPage() {
> 	return page;
> }
> 
> Why does I get such exception?
> 
> 
> P.S.
> I've used this tutorial:
> http://struts.apache.org/2.x/docs/redirect-action-result.html
> 
> 


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


RE: Problem when using result type="redirect-action"

Posted by ravindra <ra...@btpsoft.com>.
I think some thing is wrong at these lines,

<result name="*" type="redirect-action">
		         ViewTestedLetters
	         	 /admin
	         	 1
	         </result>

Your mapping should be like,
<result name="*" type="redirect-action">ViewTestedLetters</result>

All the best,

-----Original Message-----
From: holod [mailto:serega.sheypak@gmail.com] 
Sent: Tuesday, December 02, 2008 2:50 PM
To: user@struts.apache.org
Subject: Problem when using result type="redirect-action"


When I try to redirect action and set parameter value to it, I get an
exception:

[02.12.08 12:11:33:705 MSK] 00000031 OgnlUtil      W
com.opensymphony.xwork2.util.OgnlUtil internalSetProperty Caught
OgnlException while setting property 'page' on type
'org.apache.struts2.dispatcher.ServletActionRedirectResult'.
                                 ognl.NoSuchPropertyException:
org.apache.struts2.dispatcher.ServletActionRedirectResult.page
	at
ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
	at
com.opensymphony.xwork2.util.OgnlValueStack$ObjectAccessor.setProperty(OgnlV
alueStack.java:81)
	at ognl.OgnlRuntime.setProperty(OgnlRuntime.java:1656)
	at ognl.ASTProperty.setValueBody(ASTProperty.java:101)
	at ognl.SimpleNode.evaluateSetValueBody(SimpleNode.java:177)
	at ognl.SimpleNode.setValue(SimpleNode.java:246)
	at ognl.Ognl.setValue(Ognl.java:476)
	at com.opensymphony.xwork2.util.OgnlUtil.setValue(OgnlUtil.java:186)
	at
com.opensymphony.xwork2.util.OgnlUtil.internalSetProperty(OgnlUtil.java:360)
	at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:76)
	at
com.opensymphony.xwork2.util.OgnlUtil.setProperties(OgnlUtil.java:49)


my struts.xml:

<action name="ViewTestedLetters" class="admin.AdminViewTreatmentAction"
method="viewTested">
	        <result name="success" >/admin/treatmentadm.jsp</result>
</action>

<action name="ApproveLetters" class="admin.AdminEditTreatmentAction"
method="approve">
	        <result name="*" type="redirect-action">
		         ViewTestedLetters
	         	 /admin
	         	 1
	         </result>
</action>

These two action classes have field:
private int page;

These two action classes have getter and setter for the field named page:
public void setPage(int page) {
	this.page = page;
}

public int getPage() {
	return page;
}

Why does I get such exception?


P.S.
I've used this tutorial:
http://struts.apache.org/2.x/docs/redirect-action-result.html


-- 
View this message in context:
http://www.nabble.com/Problem-when-using-result-type%3D%22redirect-action%22
-tp20788608p20788608.html
Sent from the Struts - User mailing list archive at Nabble.com.


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





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