Search code examples
javastruts

Struts 1.3: forward outside the application context?


Struts 1.3 application. Main website is NOT served by struts/Java. I need to forward the result of a struts action to a page in the website, that is outside of the struts context. Currently, I forward to a JSP in context and use a meta-refresh to forward to the real location. That seems kinda sucky. Is there a better way?


Solution

  • You can't "forward", in the strict sense. Just call sendRedirect() on the HttpServletResponse object in your Action class's execute() method and then, return null.

    Alternately, either call setModule() on the ActionForward object (that you are going to return) or set the path to an absolute URI.