• Post Reply Bookmark Topic Watch Topic
  • New Topic

remmeber the URL design question  RSS feed

 
ashish kulkarni
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have to work on web application where i need for the
user to logon with userid and password for some
functions. So it will be some thing like the user
clicks submit after entering the data on a screen, but
then i want to show a page for the user to login, and
if the login is successfull then call the original URL
with the data entered from the user and update the
database,
but how do i keep track of the URL and data which was
originially submitted.
Ashish
 
R K Singh
Ranch Hand
Posts: 5390
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ServletRequest and HttpServletRequest class has methods to get the info about URL/URI/queryString. Just check the API.
In your login form you can store URI and values enterd in last page as hidden param and after sucessful login you can use this information to display the required page.
HTH
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Authentication is built into the J2EE specification and there a ways to do exactly what you are asking through configuration of the server and without having to write a single line of code.
I suggest you check the documentation on authentication for your particular server. Form-based authentication is my preference. Authentication is supposed to be standard (it's in the spec) but in practice I've seen it done very differently by some vendors, so best to check first.
Authentiaction tells informs the server how to authenticate someone (ie confirm they are who they say they are) and then you can use the authorisation component to define what that person is allowed to do.
In your case, you secure the second page that the person must be logged in and be allowed to access the second page. When someone submits from the first page, the server holds their request and sends them to the login screen instead. If they are allowed to get in and see the next page, the server executes the query for them.
Dave
 
R K Singh
Ranch Hand
Posts: 5390
1
Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David O'Meara:
there a ways to do exactly what you are asking through configuration of the server and without having to write a single line of code.

Thanks DOM
I did not know that it can be done at server cofiguration level.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!