Two Laptop Bag*
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "User Defined Result types" Watch "User Defined Result types" New topic
Author

User Defined Result types

Khushboo Seth
Greenhorn

Joined: Feb 25, 2008
Posts: 2
Hi,

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.

Thanks.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8843
    
    7

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.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Khushboo Seth
Greenhorn

Joined: Feb 25, 2008
Posts: 2
Thanks. Its working !!!
 
Don't get me started about those stupid light bulbs.
 
subject: User Defined Result types
 
Similar Threads
SQL Server 2008 connection failure
Struts2.0 interceptor Problem
But this code, throws the exception "The Struts dispatcher cannot be found".
Struts 2.1 Need two different success results
Integerating DWR with security logic