You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Korbinian Bachl <ko...@whiskyworld.de> on 2017/03/16 11:13:04 UTC

wicket 7 / 8.x and relative to absolute path

Hello,

how is it possible to make from an relative page path and absolute one as string in wicket 7 or 8?

In wicket 1.4 it was quite a mess where one had to manually build it from string and this tended to be quite buggy (and much much code), and I somehow hope that it may now be easier in times of wicket 8 and java 8;

The idea is to have a basic funtion e.g:

public static String toAbsolutePath(String relativePagePath) 

where one could enter the relativePagePath, relative to the current URL in the browser window;

Best,

Korbinian

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: wicket 7 / 8.x and relative to absolute path

Posted by Sven Meier <sv...@meiers.net>.
Hi,

getRequestCycle().getUrlRenderer().renderFullUrl(Url.parse(url)) should 
work.

Have fun
Sven

P.S.: To get the url of the current page use urlFor(new 
RenderPageRequestHandler(new PageProvider(this))


On 16.03.2017 12:13, Korbinian Bachl wrote:
> Hello,
>
> how is it possible to make from an relative page path and absolute one as string in wicket 7 or 8?
>
> In wicket 1.4 it was quite a mess where one had to manually build it from string and this tended to be quite buggy (and much much code), and I somehow hope that it may now be easier in times of wicket 8 and java 8;
>
> The idea is to have a basic funtion e.g:
>
> public static String toAbsolutePath(String relativePagePath)
>
> where one could enter the relativePagePath, relative to the current URL in the browser window;
>
> Best,
>
> Korbinian
>
> ---------------------------------------------------------------------
> 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