Hi,

> Hi all,
> 
> I've searched around to no avail for an example on how to get the
> domain name of the server where the wicket application runs on.
> Can anybody help with this?
Something like:


HttpServletRequest request = (HttpServletRequest) ((WebRequestCycle) 
getRequestCycle()).getRequest();
// maybe we are behind a proxy
String header = request.getHeader("X-Forwarded-Host");
if(header != null) {
        // we are only interested in the first header entry
        header = new StringTokenizer(header,",").nextToken().trim();
}
if(header == null) {
        header = request.getHeader("Host");
}
return header;


Best Regards,
        Ilja Pavkovic

-- 
binaere bauten gmbh · tempelhofer ufer 1a · 10961 berlin

   +49 · 171 · 9342 465

Handelsregister: HRB 115854 - Amtsgericht Charlottenburg
Geschäftsführer: Dipl.-Inform. Ilja Pavkovic, Dipl.-Inform. Jost Becker

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to