Wes Gamble wrote:
> I've generated a WAR file around a small Merb. (0.9.3) app. using
> Warbler (0.9.10). Although I can get it to work fine in Websphere's
> Community Edition (which is basically Apache Geronimo/Tomcat), I
> cannot get it to work on Websphere 6.1 (on either AIX or Windows XP).
> "Get it to work" means successfully retrieve the request for "/" which
> is mapped to my "users" controller, index action.
>
> I know that the Web app. deployment has worked in Websphere because I
> can retrieve all of the static resources (images, stylesheets) with no
> problem.
>
> Behavior in Websphere 6.1 on AIX:
>
> 2) If I request "/" or "/users/index", I see no errors in the out or
> err logs, just "Error 404: SRVE0190E: File not found: {0} " on the
> screen.
>
> Clearly the servlet filter isn't being picked up at all here.
So I've taken a look at the jruby-rack source to see if I could figure
out what's going on. I have a theory.
Here is the doFilter() method of org.jruby.rack.RackFilter:
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
HttpServletRequest httpRequest = maybeAppendHtmlToPath(request);
HttpServletResponse httpResponse = (HttpServletResponse) response;
ResponseStatusCapture capture = new
ResponseStatusCapture(httpResponse);
chain.doFilter(httpRequest, capture);
if (capture.isError()) {
httpResponse.reset();
request.setAttribute(RackDispatcher.DYNAMIC_REQS_ONLY,
Boolean.TRUE);
dispatcher.process((HttpServletRequest) request, httpResponse);
}
}
The way that this appears to work is that the
chain.doFilter(httpRequest, capture) call occurs for our dynamic request
(e.g. "/users/index"). It will fail of course, since there is no file
or servlet configured for that URI. What should happen is that the
capture variable (which is an instance of class ResponseStatusCapture
extends HttpServletResponseWrapper) should have its status set to 404
and then the "if (capture.isError())" block will be executed, which will
actually dispatch the request to Merb.
The fact that I get the 404 back indicates to me that the capture
variable does not get it's status set as expected, and therefore cannot
be properly interrogated as to whether isError() is true, and thus, no
dispatching on to Merb.
Does this make sense? Can anyone help me figure out how best to verify
it?
Thanks,
Wes
My theory is that for
---------------------------------------------------------------------
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email