Hello,
What is the best way to dynamically inform the render methods about a different
JSP page to use for a particular request? For example, depending on some logic in processRequest(), I might want to forward a user to "/test1.jsp" or "/test2.jsp". This is determined in processRequest(..), but the request dispatcher in the render methods need to know the destination. What would be the best way to inform it? The only (unelegant) solution I can think of is to set an attribute in the request with the destination in processRequest(), and then read it in render().
Can anyone think of a better way? I thought about using a private instance variable (set by processRequest, read by render), but this would probably have ramifications in a multi-threaded environment.
Regards.