The reason I have implemented the hook:

Our users are using mod_proxy all the time
So port and context are might be changed and I need to get the base URL
after all these modifications (to create emails with links etc.)


On Wed, Mar 12, 2014 at 11:24 PM, Sebastien <seb...@gmail.com> wrote:

> Hi Maxim,
>
> Maybe you might use something like this:
> Url baseUrl = new
> Url(page.getRequestCycle().getUrlRenderer().getBaseUrl());
>
> I used it to retrieve the relative url:
>
>     private static String getUrl(WebPage page)
>     {
>         Url pageUrl = Url.parse(page.urlFor(page.getClass(),
> null).toString());
>         Url baseUrl = new
> Url(page.getRequestCycle().getUrlRenderer().getBaseUrl());
>
>         baseUrl.resolveRelative(pageUrl);
>
>         return String.format("%s/%s", page.getRequest().getContextPath(),
> baseUrl);
>     }
>
>
> Best regards,
> Sebastien.
>
>
> On Wed, Mar 12, 2014 at 5:14 PM, Maxim Solodovnik <solomax...@gmail.com
> >wrote:
>
> > Hello,
> >
> > I'm currently using SelfUpdatingAjaxBehavior [1] to get application base
> > URL used by the end user.
> >
> > Maybe there is more standard way of doing this?
> > Or maybe code like this can be added to ClientInfo?
> >
> > Thanks in advance!
> >
> > [1]
> >
> >
> https://svn.apache.org/viewvc/openmeetings/trunk/singlewebapp/src/web/java/org/apache/openmeetings/web/util/BaseUrlAjaxBehavior.java?view=markup
> >
> > --
> > WBR
> > Maxim aka solomax
> >
>



-- 
WBR
Maxim aka solomax

Reply via email to