Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Quick JSP question

  • 26-01-2005 4:21pm
    #1
    Registered Users, Registered Users 2 Posts: 2,325 ✭✭✭


    I have a webpage that has a login and a password. The user enters their username and password into a form which opens up a new jsp page that checks the login details. My question is how do i open up a page based on whether they have ented in the correct details? I have the following code :
    // Iterate over the ResultSet
    String user, pass;
    boolean found = false;
    user = request.getParameter("username");
    pass = request.getParameter("password");
    
    while  (rs.next()) {
             out.println("<TR>\n<TD> checking\n </TD>");
             if (rs.getString("loginName").equals(user)){
    	out.println("<TR>\n<TD> found user\n </TD>");
    	
                 if (rs.getString("loginPassword").equals(pass)) {
    	   out.println("<TR>\n<TD> found password\n </TD>");
    	}//end if
    
             }//end if
    
    } //end while
    
    

    I've tested this code and while its not pretty it works. But i want it to open a menu page if the details are valid or return to the login page if the details are invalid. I have the seperate page for checking because i dont really know how to incorporate the checking in the login page.

    Any ideas?

    All the best,

    Darren


Comments

  • Moderators, Politics Moderators Posts: 41,240 Mod ✭✭✭✭Seth Brundle


    <jsp:forward page="menu_page.jsp"/>


  • Registered Users, Registered Users 2 Posts: 2,325 ✭✭✭Q_Ball


    dude that works brilliantly thank you!


Advertisement