You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mohammed <de...@panamp.de> on 2001/12/05 11:01:48 UTC
Problem forwarding to an action within another Action
Hi,
In my action1 with path "/action1" ( in the struts-conf.xml file) I am
forwarding to Action2 with path "/action2" as follow:
return new ActionForwar("/action1");
I am getting the the following error in the browser:
Error status 404
request resource ( /action1) is not available
thanks for your help
Mohammed
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
Re: Problem forwarding to an action within another Action
Posted by Mohammed <de...@panamp.de>.
Hi Robert,
thank you , I found my error I musst do :
return new ActioForward("/action1. staft", false)
because I mapped my actionServlet to *.staft
Mohammed
----- Original Message -----
From: "Robert Taylor" <rt...@mulework.com>
To: "Struts Users Mailing List" <st...@jakarta.apache.org>
Sent: Wednesday, December 05, 2001 11:14 AM
Subject: RE: Problem forwarding to an action within another Action
> Mohammed,
> the code below comes from the ActionServlet.processActionForward()
>
> <snip>
> if (forward != null) {
> String path = forward.getPath();
> if (forward.getRedirect()) {
> if (path.startsWith("/"))
> path = request.getContextPath() + path;
> response.sendRedirect(response.encodeRedirectURL(path));
> } else {
> RequestDispatcher rd =
> getServletContext().getRequestDispatcher(path);
> if (rd == null) {
>
> response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
>
> internal.getMessage("requestDispatcher",
> path));
> return;
> }
> rd.forward(request, response);
> }
> }
> </snip>
>
> It seems to indicate that your request is being redirected and therefore
the
> orignal request resource is lost.
> That's my best guess.
>
> robert
>
> > -----Original Message-----
> > From: Mohammed [mailto:dev4.java@panamp.de]
> > Sent: Wednesday, December 05, 2001 5:02 AM
> > To: Struts Users Mailing List
> > Subject: Problem forwarding to an action within another Action
> >
> >
> > Hi,
> >
> >
> > In my action1 with path "/action1" ( in the struts-conf.xml file) I am
> > forwarding to Action2 with path "/action2" as follow:
> >
> > return new ActionForwar("/action1");
> >
> > I am getting the the following error in the browser:
> >
> > Error status 404
> >
> > request resource ( /action1) is not available
> >
> > thanks for your help
> >
> > Mohammed
> >
> >
> > --
> > To unsubscribe, e-mail:
> <ma...@jakarta.apache.org>
> For additional commands, e-mail:
> <ma...@jakarta.apache.org>
>
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>
RE: Problem forwarding to an action within another Action
Posted by Robert Taylor <rt...@mulework.com>.
Mohammed,
the code below comes from the ActionServlet.processActionForward()
<snip>
if (forward != null) {
String path = forward.getPath();
if (forward.getRedirect()) {
if (path.startsWith("/"))
path = request.getContextPath() + path;
response.sendRedirect(response.encodeRedirectURL(path));
} else {
RequestDispatcher rd =
getServletContext().getRequestDispatcher(path);
if (rd == null) {
response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
internal.getMessage("requestDispatcher",
path));
return;
}
rd.forward(request, response);
}
}
</snip>
It seems to indicate that your request is being redirected and therefore the
orignal request resource is lost.
That's my best guess.
robert
> -----Original Message-----
> From: Mohammed [mailto:dev4.java@panamp.de]
> Sent: Wednesday, December 05, 2001 5:02 AM
> To: Struts Users Mailing List
> Subject: Problem forwarding to an action within another Action
>
>
> Hi,
>
>
> In my action1 with path "/action1" ( in the struts-conf.xml file) I am
> forwarding to Action2 with path "/action2" as follow:
>
> return new ActionForwar("/action1");
>
> I am getting the the following error in the browser:
>
> Error status 404
>
> request resource ( /action1) is not available
>
> thanks for your help
>
> Mohammed
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>