struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Pratt" <thechrispr...@gmail.com>
Subject Re: Getting an URL for an Action
Date Wed, 07 Jan 2009 17:02:01 GMT
Strange?  I would have thought this was a fairly commonly needed feature and
the code in ServletUrlRenderer has a lot of hoops to jump through to make
something seemingly simple work.  Thanks for your help, I guess I'll just
have to hard code it for now.
  (*Chris*)

On Wed, Jan 7, 2009 at 5:46 AM, Musachy Barroso <musachy@gmail.com> wrote:

> hum, there is no right way after all. If you end up using UrlHelper,
> take a look at how it is used in ServletUrlRenderer:renderFormUrl,
> different methods are used depending on whether an action mapping was
> found or not.
>
> musachy
>
> On Wed, Jan 7, 2009 at 12:00 AM, Chris Pratt <thechrispratt@gmail.com>
> wrote:
> > Is there a right way to do it?
> >  (*Chris*)
> >
> > On Tue, Jan 6, 2009 at 5:24 PM, Musachy Barroso <musachy@gmail.com>
> wrote:
> >
> >> I wouldn't advise you to use UrlHelper, given that Struts 2 doesn't
> >> have an API, that class can change without warning (it does from time
> >> to time)
> >>
> >> musachy
> >>
> >> On Tue, Jan 6, 2009 at 7:56 PM, Chris Pratt <thechrispratt@gmail.com>
> >> wrote:
> >> > I'm trying to turn an action name into an URL from within another
> action.
> >> > I've tried:
> >> >
> >> > UrlHelper.buildUrl("action-name",request,response,null)
> >> >
> >> > Which seems to just return "action-name".  And I've tried:
> >> >
> >> > UrlHelper.buildUrl("/action-name",request,response,null)
> >> >
> >> > Which returns "/context/action-name", which is a little closer, but
> still
> >> > isn't the full, working URL.
> >> >
> >> > What am I missing?
> >> >  (*Chris*)
> >> >
> >>
> >>
> >>
> >> --
> >> "Hey you! Would you help me to carry the stone?" Pink Floyd
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
>
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message