jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicolas Chalumeau <nicolas.chalum...@gmail.com>
Subject Re: How to assert forwards?
Date Fri, 12 Aug 2005 07:56:29 GMT
Salut Niklas,

2005/8/11, Niklas Lindholm <cactuslist@nilin.se>:
> Hi!
> 
> I am writing a web application that is using an MVC design. This means
> that at the end of almost every servlet I do a
> 
> request.getRequestDispatcher("foo.jsp").forward(request, response)
> 
> 
> I some cases the servlet makes a choice between two (or more) different
> targets to forward() to. Something like:
> 
> if(somethingIsTrue)
>   request.getRequestDispatcher("foo.jsp").forward(request, response);
> else
>   request.getRequestDispatcher("bar.jsp").forward(request, response);
> 
> Is there a way to make a Cactus test case that asserts that the forward is
> being done to the correct target? I can't find any way to get information
> about what forward that has been done. 

response.getWebRequest().getURL();

> (Except trying to find out by
> looking at the resulting HTML is endXXXX(), but that doesn't seem like a
> good idea..)

Why ?? It seems a great solution : you can check more ie that there is
no error message in the page code...

Nicolas,

> 
> /Niklas
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cactus-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: cactus-user-help@jakarta.apache.org
> 
>

Mime
View raw message