Andrzej Bengner wrote:
[EMAIL PROTECTED] napisaƂ(a):
In that case, when action mapping looks like this
(as you wrote in your mail before):

<action path="/MyAction"
      input="/path/file.jsp" ...>
      <forward name="ok" path="/path/file.jsp"/>
</action>

then you have to do the following at the end of your
action (after all work has been done):

return mapping.findForward( "ok" );

I do this, but struts still forwarding me to "http://localhost/context/MyAction.do"; - not "http://localhost/context/path/MyAction.do";. And I have defined:

<forward name="ok" path="/path/file.jsp"/>

and in my struts action I return mapping.findForward("ok").
What I do wrong?

You might be misunderstanding what's happening; what makes you think Struts is forwarding to /MyAction.do and not /path/file.jsp? (it shouldn't be forwarding to /path/MyAction.do in any case.)

What should be happening is that you submit a request to /MyAction.do which executes your action; at the end of your action, you return mapping.findForward("ok") and Struts then forwards to the JSP. Since you haven't specified that this should be a redirect, Struts does an in-container forward, so the browser doesn't know anything about it and the location bar still says /MyAction.do.

If your goal is to have the browser's location bar show the path to the JSP, you could add 'redirect="true"' to your <forward/> declaration, but if that JSP needs resources supplied by your action (i.e. it wont work if accessed directly), I'd recommend you leave things as they are.

L.


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

Reply via email to