You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Tim Koop <ti...@timkoop.com> on 2011/05/04 21:06:35 UTC

Request getRequestURL method

I'm using some third party Java code that wants to call 
request.getRequestURL() where request is a 
javax.servlet.http.HttpServletRequest instance.  I know enough to put

     @Inject
     private org.apache.tapestry5.services.Request request;

in my page Java file, but for some reason 
org.apache.tapestry5.services.Request doesn't contain the 
getRequestURL() method that javax.servlet.http.HttpServletRequest does.

How can I get the requested URL of the page?  And I also need 
request.getQueryString().

Thanks.

p.s. I love Tapestry, and thank you very much to all the people who 
respond to this group answering our questions!


-- 
Tim Koop
tim@timkoop.com <ma...@timkoop.com>
www.timkoop.com <http://www.timkoop.com>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Request getRequestURL method

Posted by "Thiago H. de Paula Figueiredo" <th...@gmail.com>.
On Wed, 04 May 2011 16:25:18 -0300, Tim Koop <ti...@timkoop.com> wrote:

> To answer my own question, this works:
>
>      @Inject
>      private RequestGlobals requestGlobals;
>
>      javax.servlet.http.HttpServletRequest request =  
> requestGlobals.getHTTPServletRequest();

Better yet:

@Inject
private HttpServletRequest request;

-- 
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,  
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
http://www.arsmachina.com.br

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Request getRequestURL method

Posted by Tim Koop <ti...@timkoop.com>.
To answer my own question, this works:

     @Inject
     private RequestGlobals requestGlobals;

     javax.servlet.http.HttpServletRequest request = 
requestGlobals.getHTTPServletRequest();


Tim Koop
tim@timkoop.com <ma...@timkoop.com>
www.timkoop.com <http://www.timkoop.com>

On 04/05/2011 2:06 PM, Tim Koop wrote:
> I'm using some third party Java code that wants to call 
> request.getRequestURL() where request is a 
> javax.servlet.http.HttpServletRequest instance.  I know enough to put
>
>     @Inject
>     private org.apache.tapestry5.services.Request request;
>
> in my page Java file, but for some reason 
> org.apache.tapestry5.services.Request doesn't contain the 
> getRequestURL() method that javax.servlet.http.HttpServletRequest does.
>
> How can I get the requested URL of the page?  And I also need 
> request.getQueryString().
>
> Thanks.
>
> p.s. I love Tapestry, and thank you very much to all the people who 
> respond to this group answering our questions!
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org


Re: Request getRequestURL method

Posted by Adam Zimowski <zi...@gmail.com>.
Hi Tim -

You can @Inject RequestGlobals and then call getHTTPServletRequest() from it.

Adam

On Wed, May 4, 2011 at 2:06 PM, Tim Koop <ti...@timkoop.com> wrote:
> I'm using some third party Java code that wants to call
> request.getRequestURL() where request is a
> javax.servlet.http.HttpServletRequest instance.  I know enough to put
>
>    @Inject
>    private org.apache.tapestry5.services.Request request;
>
> in my page Java file, but for some reason
> org.apache.tapestry5.services.Request doesn't contain the getRequestURL()
> method that javax.servlet.http.HttpServletRequest does.
>
> How can I get the requested URL of the page?  And I also need
> request.getQueryString().
>
> Thanks.
>
> p.s. I love Tapestry, and thank you very much to all the people who respond
> to this group answering our questions!
>
>
> --
> Tim Koop
> tim@timkoop.com <ma...@timkoop.com>
> www.timkoop.com <http://www.timkoop.com>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: users-help@tapestry.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tapestry.apache.org
For additional commands, e-mail: users-help@tapestry.apache.org