How cool! You guys aren't using Tapestry somewhere are you?
I love your product =)
On 8/17/06, David Harkness <[EMAIL PROTECTED]> wrote:
Henri Dupre wrote:
> I'd like to write an @Anchor component that provides anchor links with
the
> absolute url of the page so that I can easily use anchors in any page.
> How can I retrieve the current URL in a page?
I'm using this in my base page class, though I'm sure there's a spiffier
way since I'm pretty new to Tap.
@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getHttpServletRequest();
protected String getUrl ( ) {
HttpServletRequest request = getHttpServletRequest();
String url = request.getRequestURI();
String params = request.getQueryString();
if ( params != null ) {
url += "?" + params;
}
return url;
}
Peace,
Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Jesse Kuhnert
Tapestry/Dojo/(and a dash of TestNG), team member/developer
Open source based consulting work centered around
dojo/tapestry/tacos/hivemind.