What is the best way to do redirection using jsp's? I have to make a site where there are different user roles, ie. admin role vs a regular user. What is the best way to redirect the person after they login based on there role, they will have different gui's for each role? Also, what is a good way to do tabbed navigation using jsp's? After the person logs in based on there role they will have a different gui, what is a good way to implement this to cut down on the html gui code? Thanks for the help.
Hello James, what architectiure are you using for your web-application? if you have not yet decided than i will recommend struts, It isbased on MVC and will solve your problem to great extend. http://jakarta.apache.org/struts/
Prakash Dwivedi (SCJP2, SCWCD, SCBCD)
"Failure is not when you fall down, Its only when you don't get up again"
Welcome to the Ranch "James Dean"! You'll find this forum a great place to seek help on JSP pages, and there aren't many rules you'll have to worry about, but one is that proper names are required. Please take a look at the JavaRanch Naming Policy and change your display name to match it. In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious. Thanks! bear JSP Forum Bartender
Now as to your question: If you are using a Model 2 pattern architecture for your app (and you should), then the login form should submit to a servlet that will authenticate the user and determine the user's role. (This info can be put into the session for future reference by subsequent requests). Then, depending upon the determined role, you could forward to whichever JSP page is appropriate to display the UI for that role. If the role UI's are not that different, I'd opt for creating custom tags that could be used on the page to conditionally include/exclude features not appropriate for the role (rather than having a lot of similar pages with only minor role-dependent differences).