我的申请有问题。我使用Java,JSP,Servlets,html等开发了一个应用程序。
突然我提交的所有按钮都不起作用。我昨天测试了我的应用程序,它工作得非常好!今天,当我想重新测试并进行一些更改时,所有提交按钮都不起作用。 (我试图在IE,CHROME,FIREFOX中打开应用程序但它没有工作)。
.jsp页面
<body>
<form class="container">
<form id="search_form" class="form-horizontal" name="profile" action="UserController" method="POST" accept-charset="utf-8">
<%--<form class="container">--%>
<h2>Employee Management <img src="http://seeklogo.com/images/S/salon-logo-F0E41E42DD-seeklogo.com.gif" style="float: right; height: 50px; width: 50px"></h2>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#home">Home</a></li>
<li><a data-toggle="tab" href="#menu2">Appointments</a></li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane fade in active">
<h3>HOME</h3>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p>
</div>
<div id="menu2" class="tab-pane fade">
<h3>APPOINTMENTS</h3>
<div class="table-striped">
<table class="table">
<thead style="background-color: lightblue">
<tr>
<th>Employee ID</th>
<th>Date</th>
<th>Start hour</th>
<th>End hour</th>
<th>Approve</th>
<th>Decline</th>
<th>Remove</th>
</tr>
</thead>
<c:forEach var="appointment_item" items="${appointments}">
<tr><td>
<c:out value="${appointment_item.employee_id}"></c:out>
</td>
<td>
<c:out value="${appointment_item.date}"></c:out>
</td>
<td>
<c:out value="${appointment_item.hour_start}"></c:out>
</td>
<td>
<c:out value="${appointment_item.hour_end}"></c:out>
</td>
<td>
<button type="submit" name="approve_app" value="<c:out value="${appointment_item.id}"></c:out>" type="submit" class="btn btn-default">
<span class="glyphicon glyphicon-trash"></span> Approve
</button>
</td>
<td>
<button type="submit" name="decline_app" value="<c:out value="${appointment_item.id}"></c:out>" class="btn btn-default">
<span class="glyphicon glyphicon-trash"></span> Decline
</button>
</td>
<td>
<button type="submit" name="remove_app_e" value="<c:out value="${appointment_item.id}"></c:out>" class="btn btn-default">
<span class="glyphicon glyphicon-trash"></span> Remove
</button>
</td>
</tr>
</c:forEach>
</table>
</div>
</div>
</div>
</form>
答案 0 :(得分:2)
您正在使用重复的代码<form>
您无法在<form>
<form>
并且有2个解决方案
1.删除<form class="container">
2.添加<form class="container" action="?" method="POST"></form>