DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13169>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13169

org.apache.struts.actions.ForwardAction is context-relative instead of module-relative

           Summary: org.apache.struts.actions.ForwardAction is context-
                    relative instead of module-relative
           Product: Struts
           Version: Nightly Build
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Standard Actions
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


the ForwardAction seems not to be compliant with sub-applications ...
The path of the jsp passed as parameter to ForwardAction (in struts-config.xml) 
has to be context-relative, instead of module-relative ...

here is a possible solution to this (using RequestUtils.forwardURL):

-------------------------------------------------------------------
     public ActionForward execute(ActionMapping mapping, 
                      ActionForm form, 
                      HttpServletRequest request, 
                      HttpServletResponse response) 
      throws Exception { 
  
         // Create a RequestDispatcher the corresponding resource 
         String path = mapping.getParameter(); 
         if (path == null) { 
             response.sendError 
                 (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, 
                  messages.getMessage("forward.path")); 
             return (null); 
         } 

// <translate a context-relative path into a module-relative path>
ForwardingActionForward fw = new ForwardingActionForward(path); 
path = RequestUtils.forwardURL(request, fw); 
// </translate a context-relative path into a module-relative path>

         RequestDispatcher rd = 
             servlet.getServletContext().getRequestDispatcher(path); 
         if (rd == null) { 
             response.sendError 
                 (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, 
                  messages.getMessage("forward.rd", path)); 
             return (null); 
         } 
  
         // Forward control to the specified resource 
         rd.forward(request, response); 
  
         // Tell the controller servlet that the response has been created 
         return (null); 
  
     } 

-------------------------------------------------------------------

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

Reply via email to