Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Creating a login page using JSP and MySQL

843838Oct 5 2005 — edited Nov 15 2005
Hello everyone!!

I am new on this forums and also a newbie on JSP.

I am trying to create a login.jsp that works with 2 javabeans with the next procedure:

1) Get username and password in login.jsp

2) In a bean called loginuser.java make a query in MySQL to find if the username is in the table.

3) If there are any data compare passwords, if they match allow access to other page, if not, resend user to login.jsp.

I understand now how to make the comparation but I still don't catch how to resend the user to the respective pages.

Here is the code that is giving me the puzzle:
 if (userValidate==true && passValidate==true){
                    response.sendRedirect("loginsuccess.jsp");
                }
                else {
                    response.sendRedirect("loginfails.jsp");
It supossed that loginfails is a temporal page that redirect the user to login.jsp before that tell the user that the data he/she sends is incorrect.

I don't know with this information is enough to ask, thanks anyway for the help.

Travsam
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 13 2005
Added on Oct 5 2005
27 comments
1,260 views