RE: Get s:url in action

2010-10-28 Thread Altenhof, David Aron
rs Mailing List Subject: Re: Get s:url in action In struts2 it's up to ActionMapper to map url action (see http://struts.apache.org/2.1.8.1/docs/actionmapper.html for further details). I'm not sure it's the right approach but you could inject actionMapper inside your action class

Re: Get s:url in action

2010-10-28 Thread Dave Newton
On Wed, Oct 27, 2010 at 5:43 PM, Altenhof, David Aron wrote: > I need to create a URL, like one would get from , but in an action. > Are there any easy ways to do this Struts2, or should I try to fiddle aroung > getting a url from ServletContext? Other than the action extension (if you have one),

Re: Get s:url in action

2010-10-28 Thread Maurizio Cucchiara
In struts2 it's up to ActionMapper to map url action (see http://struts.apache.org/2.1.8.1/docs/actionmapper.html for further details). I'm not sure it's the right approach but you could inject actionMapper inside your action class. It's unusually question because action mapping task should be impl

Re: Get s:url in action

2010-10-27 Thread Li Ying
Not sure which part of this misson is bothering you. Basically, you need: (1)Get the context path of your web app, by invoking [ServletContext.getContextPath()] (2)Build the relative path (3)Build the query parameters what you want And then combine all of them. Most time you can implement this b

Get s:url in action

2010-10-27 Thread Altenhof, David Aron
Hi ... I need to create a URL, like one would get from , but in an action. Are there any easy ways to do this Struts2, or should I try to fiddle aroung getting a url from ServletContext?