Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/347.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将一个jsp页面链接到另一个jsp页面_Java_Html_Jsp_Servlets_Anchor - Fatal编程技术网

Java 将一个jsp页面链接到另一个jsp页面

Java 将一个jsp页面链接到另一个jsp页面,java,html,jsp,servlets,anchor,Java,Html,Jsp,Servlets,Anchor,这是一个非常简单的问题,但由于我是新手 我有两个文件: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 = requ

这是一个非常简单的问题,但由于我是新手

我有两个文件: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...
连接连接=(连接)会话.getAttribute(“连接”)//从会话检索连接 字符串lot_id=request.getParameter(“lotnum”); session.setAttribute(“批次id”,批次id); 打印(“批号报告:”); out.print(request.getParameter(“lotnum”)+“
”; // //这应该是一个锚定标记,将此页面链接到login.jsp,并从中获取错误。。。 语句sql=conn.createStatement()//使用连接创建语句 //... ... 页面其余部分的代码在这里。。。 谢谢,


非常感谢

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

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

我真傻。当然out.print可以发送html代码。。。非常感谢。