jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dennis Kempin" <dennis.kem...@googlemail.com>
Subject Re: Testing servlet redirects
Date Mon, 19 Jun 2006 21:14:40 GMT
Hi Kazuhito,

thank you for your answer. My servlet is mapped to process any request that
is made.
Lets say we have a request on /core/test.html: My servlets checks if it can
handle, if not it redirects to the default
servlet which should serve test.html (which does exist).
But instead of the contents of test.html i get the described 404 Error which
says that it cannot find "/core/ServletRedirector".
It works fine running the redirect in tomcat and jetty containers without


2006/6/19, Kazuhito SUGURI <suguri.kazuhito@lab.ntt.co.jp>:
> Hi Dennis,
> In article <eb76c8de0606170520y121126f5tecb90b6a6c5162be@mail.gmail.com>,
> Sat, 17 Jun 2006 14:20:15 +0200,
> "Dennis Kempin" <dennis.kempin@googlemail.com> wrote:
> dennis> i am using the JettyTestSetup to test a simple Servlet. This
> servlet
> dennis> sometimes calls
> dennis> getServletContext().getNamedDispatcher("default").forward(request,
> dennis> response); to redirect requests to the default servlet to serve
> static
> dennis> resources.
> dennis>
> dennis> Well this is what Jetty returns as response when such a redirect
> happens:
> dennis> HTTP ERROR: 404 /core/ServletRedirector Not Found
> dennis> RequestURI=/core/ServletRedirector
> dennis> Where core is the context path.
> Do you mean that the 404 response is the expected behavior of
> RequestDispatcher#foward() performed by your servlet?
> dennis> It is not important for me to test what the redirect returns, its
> more
> dennis> important that the servlet performs the redirect. That is what I
> want to
> dennis> test.
> dennis> Any ideas on how to test that (Testing for this error message
> would be a
> dennis> very hacky solution)?
> I don't think the error message is the expected result, however,
> I think you need to evaluate the response at endXXX(WebResponse) method
> to test RequestDispatcher#forward works as expected.
> Regards,
> ----
> Kazuhito SUGURI
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message