我有一个jsp,我使用spring form标签,一切都在罚款,直到之前。我在jsp和控制器中改变了一些东西,并开始不断获得500服务器错误,没有相关日志显示错误甚至在控制台上。不明白是什么原因造成了这个错误,在此我浪费了太多时间,并在这里感到需要帮助。
我的pojo
public class TransferInvoiceForm {
private List<TransferInvoice> TrinvoiceList;
//Getters and setters
我的控制器方法 @Controller @RequestMapping( “/资产/发票”)
//some other methods here
@RequestMapping(value ="transferInvoiceHdrForm", method = RequestMethod.GET)
protected ModelAndView showForm(final HttpServletRequest request, final HttpServletResponse response)throws Exception {
TransferInvoiceForm transferInvoice = new TransferInvoiceForm();
List<TransferInvoice> transferinvoice= transferInvoiceHdrService.getAssetCategoriesandTransfer();
transferInvoice.setTrinvoiceList(transferinvoice);
return new ModelAndView("asset/transferInvoiceHdrForm", "transferInvoice", transferInvoice);
}
和我的Jsp
<form:form method="post" action="/asset/invoice/searchctr" modelAttribute="transferInvoice">
<fieldset>
<form:select path="TrinvoiceList" class="col-xs-12 col-lg-5 form-group">
<form:option value="0" selected="true">All</form:option>
<c:forEach var="transferinvoiceType" items="${transferInvoice.TrinvoiceList}">
<form:option value="${transferinvoiceType.assetName}"></form:option>
</c:forEach>
</form:select>
<form:select path="TrinvoiceList" class="col-xs-12 col-lg-5 form-group">
<form:option value="0" selected="true">All</form:option>
<c:forEach var="transferinvoiceType" items="${transferInvoice.TrinvoiceList}">
<form:option value="${transferinvoiceType.assettoLocation}"></form:option>
</c:forEach>
</form:select>
<button class="btn btn-primary" type="submit" class="col-xs-12 col-lg-6 form-group">
<fmt:message key="button.search" />
</button>
</fieldset>
</form:form>
在其他jsp中
<form:form method="post" action="/asset/invoice/transferInvoiceConfirm" modelAttribute="transferInvoice">
<c:forEach items="${transferInvoice.TrinvoiceList}" var="invoice" varStatus="status">
</c:forEach>
<table id="assets-tbl" border="1"
class="table table-bordered table-hover table-striped">
<thead>
<tr>
<th><input id="selectall" type="checkbox" value=""></th>
<th><fmt:message key="asset.scanCode.serialNo" /></th>
<th><fmt:message key="asset.modelNo"/></th>
<th><fmt:message key="asset.name" /></th>
<th><fmt:message key="asset.invoice.toLocation" /></th>
<th><fmt:message key="asset.invoice.invoiceDate" /></th>
</tr>
</thead>
<tbody id="assets-tbl-body" >
<tr>
<td><form:checkbox path="TrinvoiceList[${status.index}].check"/></td>
<td><form:hidden path="TrinvoiceList[${status.index}].scanserialCode"/>${invoice.scanserialCode}</td>
<td><form:hidden path="TrinvoiceList[${status.index}].modelNum"/>${invoice.modelNum}</td>
<td><form:hidden path="TrinvoiceList[${status.index}].assetName"/>${invoice.assetName}</td>
<td><form:hidden path="TrinvoiceList[${status.index}].assettoLocation"/>${invoice.assettoLocation}</td>
<td><form:hidden path="TrinvoiceList[${status.index}].actualTransferDate"/>${invoice.actualTransferDate}</td>
</tr>
</tbody>
</table>
<div class="panel-footer">
<div class="row">
<div class="col-lg-7 col-sm-offset-5">
<input class="btn btn-primary" type="submit" value="Confirm">
</div>
</div>
</div>
</form:form>
从
调用控制器方法 <a href='<c:url value="/asset/invoice/transferInvoiceHdrForm" />' style="float: right">
寻求帮助。 感谢