Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

action chain tag

 
Sachin Raju
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is a action tag like this in my application. What happens here? whether the request goes to the render action or the page product_main.jsp is displayed? How to find this? Thanks

<action name="viewedit_ajax" com.tebs.augusta.web.actions.product.ProductAction_viewedit">
<result type="chain">render</result>
<result name="input">product_main.jsp</result>
</action>
 
Anbarasu Aladiyan
Ranch Hand
Posts: 182
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sachin Raju wrote: whether the request goes to the render action or the page product_main.jsp is displayed?

product_main.jsp page will be displayed whenever your action returns a string as 'input'. Request will be forwarded to 'render' action if the action returns other than 'input' string.
If you do not provide 'name' attribute then it will treated as default one. When the string returned from the action do not have relevant result mapping then this default result will be used.
Attribute 'type' is used to tell what type of the result to be used.

action tag in your code is wrong, it is missing class attribute
Also please use code tags
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Anbarasu Aladiyan wrote:If youhat do not provide 'name' attribute then it will treated as default one. When the string returned from the action do not have relevant result mapping then this default result will be used.

That's incorrect. If no "name" attribute is provided it gets the result name "success". Unless the action method returns "success" the result won't be used. If an action method returns a result name that is not defined you'll get an error message along the lines of "there is no result named 'xxx' defined for action yyy" or something similar.
 
Sachin Raju
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
what happens to the chain type?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean?
 
Sachin Raju
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<result type="chain">render</result>
<result name="input">product_main.jsp</result>

Which will get executed?
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...

Whichever one your action says to.
 
Anbarasu Aladiyan
Ranch Hand
Posts: 182
Chrome Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
David Newton wrote:That's incorrect. If no "name" attribute is provided it gets the result name "success". Unless the action method returns "success" the result won't be used. If an action method returns a result name that is not defined you'll get an error message along the lines of "there is no result named 'xxx' defined for action yyy" or something similar.
Yup. I am sorry about it. David, thanks for pointing it out!
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No apologies necessary :)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic