This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Struts and the fly likes User Defined Result types Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Frameworks » Struts
Bookmark "User Defined Result types" Watch "User Defined Result types" New topic

User Defined Result types

Khushboo Seth

Joined: Feb 25, 2008
Posts: 2

My requirement is to redirect from login page to various other pages depending upon the role of the user as each user is provided with a set of rights.
Please tell me how we can define result types?
At present,using the xwork jar the types available are SUCCESS,INPUT,LOGIN,ERROR,NONE.

Joe Ess

Joined: Oct 29, 2001
Posts: 9137

Result names can be any String value. The xwork values are simply commonly used defaults. Struts maps the return value of the execute method to what's declared in struts.xml.
If you want to get fancy and use symbols instead of String literals, create an interface with the role names as static Strings and have your action "implement" it.

[How To Ask Questions On JavaRanch]
Khushboo Seth

Joined: Feb 25, 2008
Posts: 2
Thanks. Its working !!!
Have you checked out Aspose?
subject: User Defined Result types
It's not a secret anymore!