Re: Getting server-url ?

2009-11-17 Thread Uwe Schäfer

Martin Grigorov schrieb:


it should return http://www.serverurl.com

((WebRequest) getRequest()).getHttpServletRequest().getServerHost()
or something like that


pass the httpServletRequest to

public static StringBuffer getContextUrl(final HttpServletRequest req)
{
String protocol = req.isSecure() ? "https://"; : "http://";;
String hostname = req.getServerName();
int port = req.getServerPort();
StringBuffer url = new StringBuffer(128);
url.append(protocol);
url.append(hostname);
if ((port != 80) && (port != 443))
{
url.append(":");
url.append(port);
}
String ctx = req.getSession().getServletContext().getContextPath();
if (!ctx.startsWith("/"))
{
url.append('/');
}
url.append(ctx);
if (!ctx.endsWith("/"))
{
url.append('/');
}
return url;
}

cu uwe

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



Re: Getting server-url ?

2009-11-17 Thread Martin Grigorov
On Tue, 2009-11-17 at 14:34 +, Peter Arnulf Lustig wrote:
> Hi,
> 
> how can I get the server-url on which the wicket application is running?
> 
> like http://www.serverurl.com/WicketApp/
> 
> it should return http://www.serverurl.com
((WebRequest) getRequest()).getHttpServletRequest().getServerHost()
or something like that
> 
> Thank you
> 
> 
> __
> Do You Yahoo!?
> Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz 
> gegen Massenmails. 
> http://mail.yahoo.com 
> 
> -
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
> 
> 



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



Getting server-url ?

2009-11-17 Thread Peter Arnulf Lustig
Hi,

how can I get the server-url on which the wicket application is running?

like http://www.serverurl.com/WicketApp/

it should return http://www.serverurl.com

Thank you


__
Do You Yahoo!?
Sie sind Spam leid? Yahoo! Mail verfügt über einen herausragenden Schutz gegen 
Massenmails. 
http://mail.yahoo.com

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