wood burning stoves 2.0*
The moose likes JSP and the fly likes How specify the next page after form log on. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "How specify the next page after form log on." Watch "How specify the next page after form log on." New topic
Author

How specify the next page after form log on.

Udara Amarasinghe
Ranch Hand

Joined: Aug 17, 2009
Posts: 109

Hi,

I am developing web site using JSPs and it use form base security login and its functioning well.

But when the user log on using the login form the next page become the home page of the site,
but I need make the next page become another page other than the home page.

So please do anyone knows how to do that?

This is the form block in my JSP login page.
mallikarjun dontamsetti
Ranch Hand

Joined: Mar 18, 2011
Posts: 243

action="j_security_check" This is your solution
Udara Amarasinghe
Ranch Hand

Joined: Aug 17, 2009
Posts: 109

mallikarjun dontamsetti wrote:action="j_security_check" This is your solution


Hi Mallikarjun, did you mean implementing j_security_check function? Can you please describe it?
Gopakumar Naryanan
Ranch Hand

Joined: Jan 15, 2011
Posts: 72

Udara Amarasinghe wrote:
mallikarjun dontamsetti wrote:action="j_security_check" This is your solution


Hi Mallikarjun, did you mean implementing j_security_check function? Can you please describe it?


Hi ,

Can you please let me know what "j_security_check" is?

In general we validate the credentials and then navigate to another page,
we use either RequestDispatcher or response.sendRedirect() methods for this purpose.

using RequestDispatcher :
request.getRequestDispatcher("destinationpage.jsp").forward(request, response);

using sendRedirect():
response.sendRedirect(destinationpage.jsp"");


Thanks & Regards
Gopakumar
Udara Amarasinghe
Ranch Hand

Joined: Aug 17, 2009
Posts: 109

Hi I solved it.
It just have to Implement the security check in a servlet and add URL to that servlet into the form's action field with a parameter that represent URL to the page that you want to be the next page after log on. Then in the security check servlet reads username, password and nextPageURL and do the necessary operation with them.

Thanks Mallikarjun your comment was helped me.
 
 
subject: How specify the next page after form log on.