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
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),
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
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
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?
5 matches
Mail list logo