Probably you've misunderstood my question. My goal was not to create absolute URI (which is absolute only within a single website), but full external URL that may appear, for example, in RSS feed or mail notification.
toAbsoluteURI () method creates exactly what it says: "Converts the link to an absolute URI, a complete path, starting with a leading slash." On Mon, Dec 14, 2009 at 10:15 AM, Kristian Marinkovic < kristian.marinko...@porsche.co.at> wrote: > hi > > just inject the LinkSource service and create a Link > object which can generate the absolute URL of a page: > > @Inject > private LinkSource linkSource; > > @Inject > private ComponentResources resources; > > public void create() { > String absolute = > linkSource.createPageRenderLink(resources.getPageName(), > false).toAbsoluteURI(); > } > > > g, > kris > > > > Ilya Obshadko <ilya.obsha...@gmail.com> > 12.12.2009 13:52 > Bitte antworten an > "Tapestry users" <users@tapestry.apache.org> > > > An > Tapestry users <users@tapestry.apache.org> > Kopie > > Thema > API for obtaining absolute URL of the page? > > > > > > > Just curious, if there is an API that could create absolute URL of the > given > page? > > Looking at Link interface, there IS a method createAbsoluteURI(), but it > creates only URI, not URL meaningful for outside world. Still this kind of > API would be very useful, for example for RSS feeds, mail notifications > and > any other sort of content that is not viewed on the website itself. > > I know that it's possible to @Inject HttpServletRequest and obtain all > necessary data from it, but maybe I'm missing some easier way to do that? > > -- > Ilya Obshadko > > -- Ilya Obshadko