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]

Reply via email to