Salut Niklas,

2005/8/11, Niklas Lindholm <[EMAIL PROTECTED]>:
> 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to