This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
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 specify the next page after form log on.

 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 246
Firefox Browser Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
action="j_security_check" This is your solution
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 72
Eclipse IDE Hibernate Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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"");
 
Udara Amarasinghe
Ranch Hand
Posts: 109
Java Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic