| View previous topic :: View next topic |
amin
Joined: 24 Mar 2008 Posts: 6
|
Posted: Tue Nov 25, 2008 6:09 pm Post subject: Exception when using ServletActionRedirectResult with @Resul |
|
|
|
Hi
I am trying to redirect the success of an action to another action using the following:
@Results({
@Result(name="success", value="viewContact", params= {"namespace", "/","actionName,"viewContact", "contactId", "${contactId}", "contactType", "${contactType}"}, type=ServletActionRedirectResult.class),
@Result(name="error", value="search.error", type=TilesResult.class)
})
However I am getting the following exception:
Caused by: ognl.NoSuchPropertyException: org.apache.struts2.dispatcher.ServletActionRedirectResult.contactId
at ognl.ObjectPropertyAccessor.setProperty(ObjectPropertyAccessor.java:132)
at com.opensymphony.xwork2.ognl.accessor.ObjectAccessor.setProperty(ObjectAccessor.java:27)
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.ognl.OgnlUtil.setValue(OgnlUtil.java:197)
at com.opensymphony.xwork2.ognl.OgnlUtil.internalSetProperty(OgnlUtil.java:393)
I have looked around and upgraded to Struts 2.1.2 and am still getting the exception. Would it be possible if someone can advise me on what I am doing wrong.
Thanks
Amin |
|
| Back to top |
|
|
|
|
 |
amin
Joined: 24 Mar 2008 Posts: 6
|
Posted: Wed Nov 26, 2008 3:37 pm Post subject: |
|
|
|
Hi
Can anyone help with the problem that I am encountering?
Cheers |
|
| Back to top |
|
|
wesw Site Admin
Joined: 13 Jul 2007 Posts: 85 Location: USA
|
Posted: Wed Nov 26, 2008 4:21 pm Post subject: |
|
|
|
Try doing the following -
| Code: |
@Result(
name="success",
value="viewContact",
params= {
"namespace", "/",
"actionName, "viewContact",
"requestParameters", "${#{
'contactId':contactId,
'contactType',contactType
}}"}
type=ServletActionRedirectResult.class)
|
I'm not sure if that exact syntax will work, but the error message you are getting indicates that it is trying to call setters on ServletActionRedirectResult that do not exist. However, there is a property called requestParameters that is a Map<String,String>. You might be able to massage the syntax above just enough to get it to work. _________________ Wesley Wannemacher
President, Head Engineer/Consultant
WanTii, Inc.
http://www.wantii.com |
|
| Back to top |
|
|
amin
Joined: 24 Mar 2008 Posts: 6
|
Posted: Wed Nov 26, 2008 5:28 pm Post subject: |
|
|
|
Hi
Thanks for your reply, unfortunately that did not work, i now get the following error
| Code: |
Cannot create type interface java.util.Map from value ${#{'contactId':contactId,'contactType':contactType }} - [unknown location]
at com.opensymphony.xwork2.conversion.impl.XWorkBasicConverter.convertValue(XWorkBasicConverter.java:152)
at com.opensymphony.xwork2.conversion.impl.XWorkConverter.convertValue(XWorkConverter.java:313)
|
followed by:
| Code: |
Caused by: java.lang.IllegalAccessException: Class ognl.OgnlRuntime can not access a member of class org.apache.struts2.dispatcher.ServletActionRedirectResult with modifiers "private"
at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:65)
|
Thanks for your help! |
|
| Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
Powered by phpBB © 2001, 2002 phpBB Group |
|
|
|
|