You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Sanket Sharma <sa...@gmail.com> on 2014/04/28 22:42:31 UTC

Inject remote IP address in a Page

Hi,

I have a requirement where I would like to retrieve the remote IP address
of the client in several pages in my application. Currently, I'm resorting
to using HttpServletRequest obtained via RequestGlobals on each of my page.

I was wondering If I could via some mechanism have the IP address injected
into a page variable using the @Inject annotation? I know this is a little
vague..but was wondering if there is a way to do this?

Thank you for your assistance.


Best Regards,
Sanket

Re: Inject remote IP address in a Page

Posted by Thiago H de Paula Figueiredo <th...@gmail.com>.
On Mon, 28 Apr 2014 17:42:31 -0300, Sanket Sharma <sa...@gmail.com>  
wrote:

> Hi,

Hi!

> I have a requirement where I would like to retrieve the remote IP address
> of the client in several pages in my application. Currently, I'm  
> resorting to using HttpServletRequest obtained via RequestGlobals on  
> each of my page.

You can @Inject HttpServletRequest directly. No need to use RequestGlobals.

> I was wondering If I could via some mechanism have the IP address  
> injected into a page variable using the @Inject annotation? I know this  
> is a little vague..but was wondering if there is a way to do this?

No, and I don't think implementing it is worth the effort..

-- 
Thiago H. de Paula Figueiredo
Tapestry, Java and Hibernate consultant and developer
http://machina.com.br

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