jakarta-cactus-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Niklas Lindholm <cactusl...@nilin.se>
Subject How to assert forwards?
Date Thu, 11 Aug 2005 21:41:22 GMT
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. (Except trying to find out by 
looking at the resulting HTML is endXXXX(), but that doesn't seem like a 
good idea..)

/Niklas

Mime
View raw message