Исключение при попытке пересылки на другой URL в Tapestry 3
У меня есть это приложение для гобеленов, у меня есть 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>
прослушиватель событий filterContracts в классе Java:
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.qupest.ResponseOutputStream.innerWrite(ResponseOutputStream.java:246) org.apache.tapestry.request..tapestry.engine.AbstractEngine.service(AbstractEngine.java:928) org.apache.tapestry.ApplicationServlet.doService(ApplicationServlet.java:197) com.vitechinc.core.VitechApplicationServlet.doService(VitechApp) (org).tapestry.ApplicationServlet.doPost(ApplicationServlet.java:326) javax.servlet.http.HttpServlet.service(HttpServlet.java:727) javax.servlet.http.HttpServlet.service.Hetp.Servlet.jpg.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.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) org.springframework.orm.hibernate3.support. org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1187) com.vitechinc.v3.core.connectionmanagement.ConnectionSettingsFilter.doFilter(ConnectionSettingsFilter.java.Dprf.invokeDelegate(DelegatingFilterProxy.java:236) org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) org.eclipse.jetty.servlet.ServletHandler$CachedChain.jlg.serg.hl. JE tty.servlet.ServletHandler.doHandle(ServletHandler.java:421) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:119) org.eclipse.jetty.security.SecurityHandler.hand.le 493) org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:225) org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:930) org.eclipse.jetty. ServletHandler.doScope(ServletHandler.java:358) org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:183) org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler66) org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:117) org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:113) org.eclipse.jetty.ser.Server.handle(Server.java:351) org.eclipse.jetty.server.HttpConnection.handleRequest(HttpConnection.java:594) org.eclipse.jetty.server.HttpConnection$RequestHandler.content(HttpConnection.java:1058) или.eclipse.jetty.http.HttpParser.parseNext(HttpParser.java:764) org.eclipse.jetty.http.HttpParser.parseAvailable(HttpParser.java:217) org.eclipse.jpg.http.:424) org.eclipse.jetty.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:489) org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:4g.ava. бежать (Thread.java:662)
Я думаю, что что-то не так в цикле перемотки