Re: dynamic forwarding from Action class to any url
This might work: ${newPage} You might consider some sort of white list of internal resources that can be accessed to prevent misuse. Nils-H On 9/7/07, Mirbek Nosinov <[EMAIL PROTECTED]> wrote: > Is it possible to dynamicaly forward to any page from Action class execute() > function. For example i get next request: > > /MyAction.action?newPage=AnotherAction.action > or > /MyAction.action?newPage=/pages/myJsp.jsp > or > /MyAction.action?newPage=www.com > > and this newPage parameter can be any url (suppose we get it from user). > And i want to forward or redirect to thin newPage url from my Action class > execute() function. How can i do this. > > Thanks in advanced > - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic forwarding from Action class to any url
> > Is it possible to dynamicaly forward to any page from Action class > > execute() Make your Action implement ServletResponseAware, then just use the response.sendRedirect() method to redirect to where you want to go. Then return null from your action to let Struts 2 know that you've handled things yourself. (*Chris*) - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: dynamic forwarding from Action class to any url
Yes it is correct for Struts 1, but i use Struts 2 2007/9/7, Gundersen, Richard <[EMAIL PROTECTED]>: > > I do it this way (create a new ActionForward with the url you want in > the Action method you are executing, and just return that instead of > doing mapping.findForward... > >ActionForward forward = new ActionForward(url); >return forward; > > Richard Gundersen > Java Developer > > Email: [EMAIL PROTECTED] > Phone: 01618302398 > Fax: 01618342536 > London Scottish Bank plc > 24 Mount Street > Manchester > M2 3LS > > -Original Message- > From: Mirbek Nosinov [mailto:[EMAIL PROTECTED] > Sent: Friday, September 07, 2007 1:06 PM > To: user@struts.apache.org > Subject: dynamic forwarding from Action class to any url > > Is it possible to dynamicaly forward to any page from Action class > execute() > function. For example i get next request: > > /MyAction.action?newPage=AnotherAction.action > or > /MyAction.action?newPage=/pages/myJsp.jsp > or > /MyAction.action?newPage=www.com > > and this newPage parameter can be any url (suppose we get it from user). > And i want to forward or redirect to thin newPage url from my Action > class > execute() function. How can i do this. > > Thanks in advanced > > > __ > This email has been scanned by the MessageLabs Email Security System. > For more information please visit http://www.messagelabs.com/email > __ > > *** Disclaimer *** > > This electronic communication is confidential and for the exclusive use of > the addressee. It may contain private and confidential information. The > information, attachments and opinions contained in this E-mail are those of > its author only and do not necessarily represent those of London Scottish > Bank PLC or any other members of the London Scottish Group. > > If you are not the intended addressee, you are prohibited from any > disclosure, distribution or further copying or use of this communication or > the information in it or taking any action in reliance on it. If you have > received this communication in error please notify the Information Security > Manager at [EMAIL PROTECTED] as soon as possible and delete the > message from all places in your computer where it is stored. > > We utilise virus scanning software but we cannot guarantee the security of > electronic communications and you are advised to check any attachments for > viruses. We do not accept liability for any loss resulting from any > corruption or alteration of data or importation of any virus as a result of > receiving this electronic communication. > > Replies to this E-mail may be monitored for operational or business > reasons. London Scottish Bank PLC is regulated by the Financial Services > Authority. > __ > This email has been scanned by the MessageLabs Email Security System. > > - > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
RE: dynamic forwarding from Action class to any url
I do it this way (create a new ActionForward with the url you want in the Action method you are executing, and just return that instead of doing mapping.findForward... ActionForward forward = new ActionForward(url); return forward; Richard Gundersen Java Developer Email: [EMAIL PROTECTED] Phone: 01618302398 Fax: 01618342536 London Scottish Bank plc 24 Mount Street Manchester M2 3LS -Original Message- From: Mirbek Nosinov [mailto:[EMAIL PROTECTED] Sent: Friday, September 07, 2007 1:06 PM To: user@struts.apache.org Subject: dynamic forwarding from Action class to any url Is it possible to dynamicaly forward to any page from Action class execute() function. For example i get next request: /MyAction.action?newPage=AnotherAction.action or /MyAction.action?newPage=/pages/myJsp.jsp or /MyAction.action?newPage=www.com and this newPage parameter can be any url (suppose we get it from user). And i want to forward or redirect to thin newPage url from my Action class execute() function. How can i do this. Thanks in advanced __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ *** Disclaimer *** This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at [EMAIL PROTECTED] as soon as possible and delete the message from all places in your computer where it is stored. We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication. Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is regulated by the Financial Services Authority. __ This email has been scanned by the MessageLabs Email Security System. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]