Monday, August 05, 2013

Get Absolute Url in Tapestry4 and Tapestry5

In Tapestry 4 for getting the absolute Url we use
IRequestCycle obCycle = (IRequestCycle)event.getRequestCycle();
obCycle.getAbsoluteURL("/app?page=Login&service=page");
In Tapestry5 we can use the below code to get the absolute url.
@Inject
PageRenderLinkSource linkSource;

Link link = linkSource.createPageRenderLinkWithContext(
                "DepartmentMasterPG",
                5);
String s = link.toAbsoluteURI();

No comments: