You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Niranjan Rao <nh...@gmail.com> on 2011/12/20 03:52:39 UTC
Getting url for a page
Hi folks,
On wicket 1.5.1
I have a page that calls a JSON service url in different package. For
simplicity let's just say, Page resides in page package and services
reside in services package. Layout is something as follows
page:
Page
sercices:
ServiceA
ServiceB
Page calls get urlFor for ServiceA. This works fine. ServiceA calls for
urlFor ServiceB to include dynamic list of images and sets appropriate
request parameters. In this case urlFor for serviceB returns the url
relative to serviceA - which are in same package. However caller is in
different package and breaks the link. In short I need either absolute
url or url relative to Page in above scenario.
How do I achieve this?
Thanks,
Niranjan
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org
Re: Getting url for a page
Posted by Francois Meillet <qq...@gmail.com>.
Hi Niranjan,
Url url = RequestCycle.get().mapUrlFor(pageClass, parameters);
String fullurl = RequestCycle.get().getUrlRenderer().renderFullUrl(url);
François
Le 20 déc. 2011 à 03:52, Niranjan Rao a écrit :
> Hi folks,
>
> On wicket 1.5.1
>
> I have a page that calls a JSON service url in different package. For simplicity let's just say, Page resides in page package and services reside in services package. Layout is something as follows
>
> page:
> Page
>
> sercices:
> ServiceA
> ServiceB
>
> Page calls get urlFor for ServiceA. This works fine. ServiceA calls for urlFor ServiceB to include dynamic list of images and sets appropriate request parameters. In this case urlFor for serviceB returns the url relative to serviceA - which are in same package. However caller is in different package and breaks the link. In short I need either absolute url or url relative to Page in above scenario.
>
> How do I achieve this?
>
> Thanks,
>
> Niranjan
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org