For developers, I suggest looking into this proposed enhancement. Instead of 
duplicating the path
again in the forward, you can forward to actions. Please vote for this if you 
think it is
valuable; perhaps it will make it into future versions of 1.3 or 1.4.

http://issues.apache.org/bugzilla/show_bug.cgi?id=37479

--- Laurie Harper <[EMAIL PROTECTED]> wrote:

> 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]
> 
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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

Reply via email to