I've used this to show the full URL to one of my pages as the model object of a hyperlink including the paramaters (since I have a bookmarkable page):
HttpServletRequest httpReq = (HttpServletRequest)((WebRequest)RequestCycle.get().getRequest()).getContainerRequest(); String relativePagePath = urlFor(DownloadMSIPage.class, params).toString(); String url = RequestUtils.toAbsolutePath(httpReq.getRequestURL().toString(), relativePagePath); ~ Thank you, Paul Bors On Wed, Apr 3, 2013 at 8:44 AM, Andrea Del Bene <[email protected]>wrote: > Hi, > > do you know the best way to get the base URL for our Wicket application? > For example > > "http://www.mysite.com/**myapplication<http://www.mysite.com/myapplication> > " > > I'm using the following code at the moment: > > > protected CharSequence extractBaseUrl(Request request) { > Url originalUrl = request.getOriginalUrl(); > CharSequence baseUrl = originalUrl.getProtocol() + "://" + > originalUrl.getHost() + > ":" + originalUrl.getPort() + > request.getContextPath(); > > > return baseUrl; > } > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > users-unsubscribe@wicket.**apache.org<[email protected]> > For additional commands, e-mail: [email protected] > >
