这是我的success.jsp页面,它有一个按钮名称Employee List,它打开一个新的页面viewEmployee.jsp,我想只在点击按钮时在success.jsp页面中包含viewEmployee.jsp页面
<html>
<body>
<form action="index.jsp">
<table>
<tr>
<td align="left">Welcome !! <%=session.getAttribute("user")%></td>
<td align="right"> <input type="submit" value="Logout"></td>
</tr>
</table>
<hr>
<h2>Choose your action to perform...</h2>
<table align="center">
<tr>
<td><h3>
<input type="button" value="Employee List" onclick="window.location='viewEmployee.jsp'" /> |
</h3></td>
<td><h3>
<a href="addEmployee.jsp">Add Employee </a> |
</h3></td>
<td><h3>
<a href="deleteEmployee.jsp">Delete Employee </a> |
</h3></td>
<td><h3>
<a href="updateEmployee.jsp">Update Employee </a>
</h3></td>
</tr>
</table>
<%
session.invalidate();
%>
</form>
答案 0 :(得分:0)
也许你可以尝试这个解决方案。希望它的帮助
表格中的html代码
<input type="button" value="Employee List" onClick="fnTest();" />
的Javascript
function fnText()
{
document.mainform.action="/home/folder/viewEmployee.jsp";
document.mainform.submit();
}
在第一张表格结束后添加另一张表格
<form name="mainform" method="post" ></form>