|
From: Bas S. <bas...@gm...> - 2007-09-22 21:00:56
|
Hi, I'm using Jetty embedded and want to have 2 handlers, one custom handler that extends AbstractHandler and one WebAppDeployer to handle static web content. My customer handler only responds to request at http://myhost.com/ something and calls setHandled(true) if that's the case. In all other cases it calls setHandled(false) and returns without doing anything. However, when the incoming request does start with 'something' it handles the request like this: response.setContentType("text/html"); response.setStatus(HttpServletResponse.SC_OK); response.getWriter().println("<h1>message accepted</h1>"); This gives me the following (warning) on the console: 2007-09-22 22:52:35.435::WARN: EXCEPTION java.lang.IllegalStateException: STREAM at org.mortbay.jetty.Response.getWriter(Response.java:583) at nl.connectedcreations.viapix.ViaPix.handle(ViaPix.java:64) at org.mortbay.jetty.handler.HandlerCollection.handle (HandlerCollection.java:114) at org.mortbay.jetty.handler.HandlerWrapper.handle (HandlerWrapper.java:139) at org.mortbay.jetty.Server.handle(Server.java:313) at org.mortbay.jetty.HttpConnection.handleRequest (HttpConnection.java:506) at org.mortbay.jetty.HttpConnection $RequestHandler.headerComplete(HttpConnection.java:830) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable (HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle (HttpConnection.java:381) at org.mortbay.jetty.bio.SocketConnector$Connection.run (SocketConnector.java:227) at org.mortbay.thread.BoundedThreadPool$PoolThread.run (BoundedThreadPool.java:442) I think the request is handled by *both* handlers even though I call setHandled as appropriate. The WebAppDeployer is also responding to the request, when the request starts with 'something'. How do I handle this? thanks, bas. -- bas a schulte - http:// www.connectedcreations.nl - http://www.wittezeiltjes.nl - +31653508689 -- bas a schulte - http:// www.connectedcreations.nl - http://www.wittezeiltjes.nl - +31653508689 |