我正在尝试传递到href中的参数,因为我设置了session.getAttribute,但是当我尝试从结果集中获取第二个值时,没有传递给url这里是我的jsp代码
<html>
<body>
<table border="1" align="center" background="images\blue-wallpaper-7.jpg">
<tr>
<td>PROJECT_NAME </td>
<td>HEADER</td>
<td>DESCRIPTION</td>
<td> TASK_DATE</TD>
<td>STATUS</td>
</tr>
<%
String employee_id=session.getAttribute("Employee_id").toString();
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con=DriverManager.getConnection("jdbc:oracle:thin:@172.18.114.213:1821:godb","xe","se");
Statement statement=con.createStatement();
String sql="SELECT PROJECT_ID,Employee_id,PROJECT_NAME,HEADER,DESCRIPTION,TO_CHAR(TO_DATE(TASK_DATE,'MM-DD-YYYY'),'DD-MON-YYYY') as TASK_DATE FROM EMPLOYEE_TASK WHERE TO_CHAR(TO_DATE(TASK_DATE,'MM-DD-YYYY'),'DD-MON-YYYY')>=(SYSDATE)-7 and employee_id='"+employee_id+"' order by project_id asc";
ResultSet resultset=statement.executeQuery(sql);
while(resultset.next())
{
String PROJECT_ID=resultset.getString("PROJECT_ID");
/*out.println("<script type=\"text/javascript\">");
out.write("alert('You are successfully Logout at :" + PROJECT_ID + "')");
out.println("</script>");*/
%>
<tr>
<td><%=resultset.getString("PROJECT_NAME")%></td>
<td><%=resultset.getString("HEADER")%></td>
<td><%=resultset.getString("DESCRIPTION")%></td>
<td><%=resultset.getString("TASK_DATE")%></td>
<td>
<a href="update_employeetask.jsp?id=<%=resultset.getString("Employee_id")%>&PROJECT_ID_update="<%=PROJECT_ID%>>update</a> // here i want to pass Project_id this i id will fetch request.getparameter from another page
<a href="update_employeetask.jsp?id=<%=resultset.getString("Employee_id")%>&PROJECT_ID_delete="<%=PROJECT_ID%>>Delete</a>
</td>
</tr>
<%
}
%>
</tr>
</table>
</body>
</html>
答案 0 :(得分:0)
抱歉我的英语不好,但scaraapy的灵魂正常工作
<a href="update_employeetask.jsp?id=<%=resultset.getString("Employee_id")%>&PROJECT_ID_update=<%=PROJECT_ID%>">