linking one jsp page to another jsp page

20,596

try put your folder name:

out.print("<a href='/foldername/login.jsp'>Click here to go to login page</a>");
Share:
20,596
user3044023
Author by

user3044023

Updated on November 28, 2020

Comments

  • user3044023
    user3044023 over 3 years

    This is a very simple question, but as I am a newbie...

    I have two files: login.jsp and report.jsp they are both within the same WebContent folder.

    I want a link on report.jsp that when clicked, will take me to login.jsp

    The jsp part of the page looks like:

    Connection conn = (Connection)session.getAttribute("conn"); //retrieves the connection from the session
    
    String lot_id = request.getParameter("lotnum");
    session.setAttribute("lot_id",lot_id);
    
    out.print("Report on Lot Number: ");
    out.print(request.getParameter("lotnum")+"<br>");
    
    
    //<a href="login.jsp">Click here to go to login page</a>
    // this is supposed to be an anchor tag linking this page to login.jsp, and where I am getting my error... 
    
    Statement sql = conn.createStatement();  //create statement using the connection
    
    //... ... code for the rest of the page goes here...
    

    thank you,

    much appreciated