You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by bu...@apache.org on 2002/10/01 15:06:46 UTC
DO NOT REPLY [Bug 13169] New: -
org.apache.struts.actions.ForwardAction is context-relative instead of module-relative
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: struts-dev@jakarta.apache.org
ReportedBy: phpsurf@ifrance.com
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: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>