我需要一种将 div 用作提交按钮以将表单请求发送到 Servlet 的方法,或者是否有任何其他方法可以解决我的问题。 “logoutbutton”是 div。
<div class="logoutbutton">
<table width="100%">
<tr>
<td width="50px"><img src="img/usericon.png" width="44" height="44" /></td>
<td><a style="font-size:12px; font-family:Verdana, Geneva, sans-serif; color:#FFF"><% out.print(session.getAttribute("userid")); %></a><br />
<a style="font-size:20px; font-family:Verdana, Geneva, sans-serif; color:#FFF">Log Out</a>
</td>
</tr>
</table>
</div>
最佳答案
您需要调用处理链接注销操作的 servlet。你可以使用
<a href = "LogourServletUrlPattern"> Logout </a>
执行此操作后,您可以从 LogoutServet
的 doGet
方法注销
关于java - 在 JSP Servlet 中使用 div 作为提交按钮,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18975171/