Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to display default page after jsp authentication

 
Ramana Kumar Atmakuru
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I have an application with declarative security.it works fine.It remembers the page requested and after authentication,it trasfer control to the requested page.
Now,I have question about how to tell server to display the page after successful authentication.Here,user never requested any page.He directly accessed login page and got authenticated but after this, i would like send control to default page...
how can i do this?..Can any body help with this...
Thanks guys for your time..
bye
Ramana Kumar.
 
Hans Bergsten
Author
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ramana Kumar Atmakuru:
hi,
I have an application with declarative security.it works fine.It remembers the page requested and after authentication,it trasfer control to the requested page.
Now,I have question about how to tell server to display the page after successful authentication.Here,user never requested any page.He directly accessed login page and got authenticated but after this, i would like send control to default page...
how can i do this?..Can any body help with this...
Thanks guys for your time..
bye
Ramana Kumar.

There's no way to do this with container-based authentication, no matter if you use custom pages or rely on the Basic or Digest HTTP authentication mechanisms. You need to roll your own to get this behavior, e.g., using a servlet (or Struts Action) for authentication and filter for access control. I show examples of this in my JavaServer Pages book.
 
Nicholas Cheung
Ranch Hand
Posts: 4982
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, we will configure a Filter in the Web application. For every request, it will be *scanned* by the Filter. The Filter can read a request, checks the condition, and modify the request.
Thus, if a request is from an unauthenticated user, the Filter can redirect the request to the login page. If a request is from an authenticated user, then it simply does nothing. If the request is a login request, it can check whether the login info correct, and update the request, say, by adding a login succeed token.
For this page, I read Servlet 2.4 spec., as well as the SCWCD Exam Study Kit Chapter 18.
Nick
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic