我有这个挂毯应用程序,我有一个 html 和一个后端 java 类,html 部分:
<html>
<head>
<title>Starter Page</title>
</head>
<body>
<span jwcid="@Insert" value="ognl: errorMessage" />
<form jwcid="@Form" method="POST" listener="ognl:listeners.filterContracts">
<table style="width: 100%;" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>
<label jwcid='@vitech:Label' element="span" labelOverride="Choose Criteria"/>
</td>
<td>
<select jwcid="criteriaSelect@Select">
<foreach jwcid="@Foreach" source="ognl: criterias" value="ognl:currentCriteria" index="ognl:currentCriteriaIndex">
<option jwcid="@Option" selected="ognl:selection[currentCriteriaIndex]" label="ognl:currentCriteria"/>
</foreach>
</select>
</td>
</tr>
<tr>
<td>
<label jwcid='@vitech:Label' element="span" labelOverride="Criteria Value"/>
</td>
<td>
<input jwcid="@TextField" value='ognl: criteriaValue' />
</td>
</tr>
<tr>
<td>
<label jwcid='@vitech:Label' element="span" labelOverride="Username"/>
</td>
<td>
<input jwcid="@TextField" value='ognl: username' />
</td>
</tr>
<tr>
<td>
<input type="submit" jwcid="getcontract@Submit" label="ognl: 'Get Contracts'" />
</td>
</tr>
</table>
</form>
</body>
java类中的事件监听器filterContracts:
public void filterContracts(IRequestCycle cycle) {
if(cycle.isRewinding()) {
try {
errorMessage = "";
String selectedCriteriaString = cycle.getRequestContext().getRequest().getParameter("criteriaSelect");
MetlinkVisit metlinkVisit = (MetlinkVisit)getEmployerVisit();
int selectedCriteria = Integer.parseInt(selectedCriteriaString);
List<MemberContract> allMemberContractsWithEmployer = loadEmployerBySecurityUser(username);
if(allMemberContractsWithEmployer != null && allMemberContractsWithEmployer.size() > 0) {
FilterMembersContractsByCriteria filter;
List<MemberContract> filteredMembersContractsWithEmployer;
switch(selectedCriteria) {
case 0:
filter = new FilterMembersContractsBySSN();
break;
case 1:
filter = new FilterMembersContractsByLastName();
break;
case 2:
filter = new FilterMembersContractsByGAB();
break;
case 3:
filter = new FilterMembersContractsByCertificate();
break;
default:
filter = new FilterMembersContractsBySSN();
break;
}
filteredMembersContractsWithEmployer = filter.filterAllMembersContractsWithEmployerUsingCriteria(allMemberContractsWithEmployer, criteriaValue);
if(filteredMembersContractsWithEmployer != null && filteredMembersContractsWithEmployer.size() > 0) {
metlinkVisit.setFilteredContracts(filteredMembersContractsWithEmployer);
HttpServletRequest request = cycle.getRequestContext().getRequest();
HttpServletResponse response = cycle.getRequestContext().getResponse();
String uri = request.getRequestURI();
String url = uri + "?un=" + username + "&service=external/Metlink:SummaryPage";
request.getRequestDispatcher(url).forward(request, response);
} else {
errorMessage = "Criteria doesn't match any record, try different criteria";
}
}
}catch (Exception e) {
errorMessage = e.getMessage();
}
}
}
但是当我转发到 Metlink 摘要页面时出现此异常,并且此页面加载正常:
Exceptions:
java.io.IOException: 关闭 org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:140) org.eclipse.jetty.server.HttpOutput.write(HttpOutput.java:86) org.apache.tapestry.request .ResponseOutputStream.innerWrite(ResponseOutputStream.java:246) org.apache.tapestry.request.ResponseOutputStream.open(ResponseOutputStream.java:186) org.apache.tapestry.request.ResponseOutputStream.forceFlush(ResponseOutputStream.java:144) org.apache .tapestry.engine.AbstractEngine.service(AbstractEngine.java:928) org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) com.vitechinc.core.VitechApplicationServlet.doService(VitechApplicationServlet.java:310) org.apache .tapestry.ApplicationServlet.doPost(ApplicationServlet.java:326) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service(HttpServlet.java:820) org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:527) org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1216) org.springframework.web.filter.RequestContextFilter。 doFilterInternal(RequestContextFilter.java:83) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) org.springframework。 orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler. java:1187) com.vitechinc.v3.core.connectionmanagement.ConnectionSettingsFilter.doFilter(ConnectionSettingsFilter.java:79) 组织。springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler. java:1187) org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:421) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) org.eclipse.jetty.security。 SecurityHandler.handle(SecurityHandler.java:493) org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225) org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930) org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:358) org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) org.eclipse.jetty.server.handler。ContextHandler.doScope(ContextHandler.java:866) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.server.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content( HttpConnection.java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server。 HttpConnection.handle(HttpConnection.java:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436 ) java.lang.Thread.run(Thread.java:662)doScope(ContextHandler.java:866) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org. eclipse.jetty.server.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection. java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection。处理(HttpConnection.java:424)org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489)org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)java .lang.Thread.run(Thread.java:662)doScope(ContextHandler.java:866) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org. eclipse.jetty.server.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection. java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection。处理(HttpConnection.java:424)org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489)org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)java .lang.Thread.run(Thread.java:662)jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.server.Server.handle(Server. java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http。 HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse。 jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run(Thread.java:662 )jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.server.Server.handle(Server. java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http。 HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse。 jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run(Thread.java:662 )server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.server.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable( HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty。 util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run(Thread.java:662)server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.server.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable( HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty。 util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run(Thread.java:662)handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse。 jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:第489章) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) org.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse。 jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jetty.server.HttpConnection.handle(HttpConnection.java:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:第489章) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436)424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run (线程.java:662)424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:436) java.lang.Thread.run (线程.java:662)
我猜倒带循环中出了点问题