File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Tags in struts2

 
Sachin Raju
Ranch Hand
Posts: 41
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whats the difference between <result name= and <result type= tags inside the action tag? Which one is called at what point? Please suggest. And also what does <param name tag and method tag do?

<action name="delete" method="delete"
class="org.apache.struts2.showcase.action.EmployeeAction" >
<result name="error">/empmanager/editEmployee.jsp</result>
<result type="redirect">edit-${currentEmployee.empId}.action</result>
</action>


Is there any link which explains the tags in details
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One is setting the result name with the default type, one sets the result type with the default name.

You'd use the appropriate one when you need to set on the attributes but not the other.

The Struts 2 documentation explains each of the configuration elements (not tags).
 
Nidhi Garg
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are basically 5 types present in Struts2. They are
- dispatcher
- Redirect
- rediretAction
- chain
- freemarker

If we dont specify the result type explicitly , by default it takes dispatcher
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know why you limited yourself to five, particularly when one of the five, "chain", is actively discouraged. The "stream" result is also widely used, and those doing a lot of XML work use the "xslt" result type.
 
Nidhi Garg
Greenhorn
Posts: 21
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well i read about those five only
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic