This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSP and the fly likes redirecting page Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "redirecting page" Watch "redirecting page" New topic

redirecting page

nirjari patel
Ranch Hand

Joined: Apr 23, 2009
Posts: 369
hi all.

My question has two parts. First part

I have a form in page1.jsp. the action for that form submit is in page2.jsp

In page2.jsp, validation for the username and password is done. If validation is true, then I want to just come back to the page1.jsp after processing the request.(reload the first page again)

so in page2.jsp, how can i redirect the display page to the page1.jsp

what code shal I use to check , if validation is correct or not ? What object will that be ?

Second part -

page1.jsp contains two forms, if validation is correct then a code containing will be executed otherwise an error page will display asking to enter username and password again. I believe this is not the correct way of doing it, I should redirect to the separate page. Please guide me in that , how to do that.

carina caoor
Ranch Hand

Joined: Jun 23, 2007
Posts: 300

To validate a user you can use FORM Based Authentication method just try it out instead of oscillating between JSP's.
I agree. Here's the link:
subject: redirecting page
Similar Threads
Need clarification for jsp:include.
How to make a JSP/HTML page to stay on itself when user clicks on back button on the browser?
JSF Filter prevent direct access certain page
Javascript-- how to find referrer when url redirect is done