You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Gw <no...@gmail.com> on 2010/03/04 19:01:55 UTC

how to get domain name

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?
Lots of thanks in advance

Regards,

Mike

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


Re: how to get domain name

Posted by Gw <no...@gmail.com>.
Thx, folks.
Helped a lot...
Good day...

On Thu, Mar 4, 2010 at 10:04 AM, Jeremy Thomerson
<je...@wickettraining.com> wrote:
> from the httpservletrequest
>
> http://www.jguru.com/faq/view.jsp?EID=734942
>
> note that if you use mod_proxy with apache, this may not work
>
> --
> Jeremy Thomerson
> http://www.wickettraining.com
>
>
>
> On Thu, Mar 4, 2010 at 12:01 PM, Gw <no...@gmail.com> wrote:
>
>> 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?
>> Lots of thanks in advance
>>
>> Regards,
>>
>> Mike
>>
>> ---------------------------------------------------------------------
>> 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


Re: how to get domain name

Posted by Jeremy Thomerson <je...@wickettraining.com>.
from the httpservletrequest

http://www.jguru.com/faq/view.jsp?EID=734942

note that if you use mod_proxy with apache, this may not work

--
Jeremy Thomerson
http://www.wickettraining.com



On Thu, Mar 4, 2010 at 12:01 PM, Gw <no...@gmail.com> wrote:

> 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?
> Lots of thanks in advance
>
> Regards,
>
> Mike
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

Re: how to get domain name

Posted by Ilja Pavkovic <il...@binaere-bauten.de>.
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: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org