簡體   English   中英

將一個jsp頁面鏈接到另一個jsp頁面

[英]linking one jsp page to another jsp page

這是一個非常簡單的問題,但因為我是新手......

我有兩個文件:login.jsp和report.jsp它們都在同一個WebContent文件夾中。

我想在report.jsp上找到一個鏈接,點擊它后,會將我帶到login.jsp

頁面的jsp部分看起來像:

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...

謝謝,

非常感激

嘗試把你的文件夾名稱:

out.print("<a href='/foldername/login.jsp'>Click here to go to login page</a>");

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM