前端
<form action="Confirm">
<div class="col-md-3 col-md-offset-4">
<button name="daoda" value="1" class="btn btn-primary" id="querendaoda" style="background-color: <%= color %>;border-color:<%= color %>;color: <%= front %>">确认对方已到达</button></div>
<div class="col-md-3">
<button name="daoda" value="2" class="btn btn-default" id="querenwancheng" style="background-color: lavender;color: #adadad" onclick="<%= hanshu%>">确认完成任务</button>
</div>
</form>
servlet
String value=(String)request.getParameter("daoda");
if(value.equals("1")){request.getRequestDispatcher("../Cover.html").forward(request,response);}
else if(value.equals("2"))
{request.getRequestDispatcher("../task.html").forward(request,response);}
本文介绍了一个简单的前端表单设计案例,其中包括两个按钮:确认对方已到达和确认完成任务。通过设置不同的样式和行为,这两个按钮可以触发不同的Servlet处理逻辑,进而实现页面跳转。文章展示了如何使用HTML和Servlet技术进行基本的交互设计。
379

被折叠的 条评论
为什么被折叠?



