yeah, wicket should be able to find the base url of your application. i've had to do this in a couple of projects by hand. /unfortunately/ i don't think there's any container-independent way of doing this until a first request has come in for processing. before that point in time, it seems like the absolute url to everything is actually undefined. or maybe there's something i don't know yet... ?
Ryan Sonnek-2 wrote: > > I'm trying to accomplish the same thing and think that wicket should > provide such an API. all of the "issues" mentioned are well known > issues and other web frameworks still provide an API and just > acknowledge the limitations. > > This is pretty important for me as I can't necessarily "hardcode" the > url when the application runs in several different environments > (production vs development for example). please vote for this JIRA > issue and hopefully we can get some kind of API added. > https://issues.apache.org/jira/browse/WICKET-609 > > > On Nov 23, 2007 7:03 PM, Oliver Lieven <[EMAIL PROTECTED]> wrote: >> >> Hi Sebastiaan, >> >> thanks for your answer. Excellent point on potential problems when using >> clusters, firewalls and proxies (I run into those already). >> >> I also thought on providing the URLs in a configuration file/spring >> config, >> but "feared" there might be a simple and preferred "Wicket" way to >> determine >> the URLs. >> >> Thanks alot, >> Oliver >> >> >> >> >> >> >> >> >> Sebastiaan van Erk wrote: >> > >> > What's wrong with putting this in a configuration file or just a >> > constant. Because in general this does not really work. >> > >> > For example, your web server may be behind a proxy or firewall, it may >> > be clustered (and thus you have many machines instead of just one and >> > they can't all have the same hostname), they may be running on a port > >> > 1024 because of security concerns, with the firewall redirecting >> traffic >> > on port 80 to the webserver. >> > >> > Personally I use spring and generally put the hostname/port combination >> > in a properties file which spring uses to inject it into the >> application >> > class. I have different properties files for dev and production which >> > are activated by different maven profiles. >> > >> > However if you really want to do this (which I don't advise) you can >> use >> > the HttpServletRequest to find your information using: >> > >> > getWebRequestCycle().getWebRequest().getHttpServletRequest() >> > >> > Regards, >> > Sebastiaan >> > >> > Oliver Lieven wrote: >> >> Hi, >> >> >> >> is there a way to determine the complete, absolute URL to a mounted >> page >> >> (including protocol, host, port, application, filter and destination >> >> page)? >> >> I need this to be able to send a link to a Registration-Confirmation >> page >> >> to >> >> a user via email. >> >> >> >> I searched the forum already, but didn't find a working solution. All >> I >> >> found were messages saying that since Wicket 1.3 all URLs are >> relative. >> >> Reading the JavaDoc I also found various urlFor() and >> >> getRelativePath...() >> >> methods, all returning relative paths. >> >> >> >> What I would need is a method with a signature similar to >> >> >> >> url = getAbsolutePath(Request request, Class pageClass, >> >> PageParameters >> >> parameters) >> >> >> >> which returns an url like >> >> "http://localhost:8080/myapp/app/<page-alias>?...<params>... >> >> >> >> Thanks for any hints on this, >> >> Oliver >> >> >> > >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/How-to-determine-absolute-URL-of-a-mounted-page--tf4864119.html#a13920421 >> >> Sent from the Wicket - User mailing list archive at Nabble.com. >> >> >> --------------------------------------------------------------------- >> To unsubscribe, e-mail: [EMAIL PROTECTED] >> For additional commands, e-mail: [EMAIL PROTECTED] >> >> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/How-to-determine-absolute-URL-of-a-mounted-page--tf4864119.html#a13931992 Sent from the Wicket - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
