将一个JSP页面链接到另一个JSP页面。

3
这是一个非常简单的问题,但由于我是新手...... 我有两个文件: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...

谢谢,
非常感激。
1个回答

2

请尝试输入您的文件夹名称:

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

我真傻,当然...out.print可以发送HTML代码...谢谢! - user3044023

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接