You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Adam Zimowski <zi...@gmail.com> on 2006/02/26 18:10:16 UTC
What is Tapestry's equivalent of getRemoteAddr() ?
Mornin'
I need to obtain IP address from the requester of the page. With
Servlet API I'd use HttpServletRequest getRemoteAddr().
I checked WebRequest interface in Tapestry and do not see the
equivalent. Anyone knows how to get this information?
Thank You
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: What is Tapestry's equivalent of getRemoteAddr() ?
Posted by Adam Zimowski <zi...@gmail.com>.
Yes, injectcting servlet request, or even better, the getRemoteAddr()
itself thru Hivemind works very well for me now. Thank you very much
guys. And since I'm using Tap4 & JDK 1.5 the last example is both
clean, and a right way to go.
Thanks Again!
On 2/27/06, Raul Raja Martinez <do...@estudiowebs.com> wrote:
> @InjectObject("service-property:tapestry.globals.HttpServletRequest:remoteAddr")
> public abstract String getRemoteAddr()
>
>
> or
>
>
> @InjectObject("service:tapestry.globals.HttpServletRequest")
> public abstract HttpServletRequest getServletRequest();
>
> and then do whatever with the HttpServletRequest
>
>
> best regards.
>
> Raul Raja.
>
> Lindsay Steele wrote:
> > getRequestCycle().getRequestContext().getRequest().getRemoteAddr();
> >
> > works for me - but throws deprecation warnings. Happy to see if anyone
> > suggests something better.
> >
> > Adam Zimowski wrote:
> >> Mornin'
> >>
> >> I need to obtain IP address from the requester of the page. With
> >> Servlet API I'd use HttpServletRequest getRemoteAddr().
> >>
> >> I checked WebRequest interface in Tapestry and do not see the
> >> equivalent. Anyone knows how to get this information?
> >>
> >> Thank You
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >>
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: What is Tapestry's equivalent of getRemoteAddr() ?
Posted by Raul Raja Martinez <do...@estudiowebs.com>.
@InjectObject("service-property:tapestry.globals.HttpServletRequest:remoteAddr")
public abstract String getRemoteAddr()
or
@InjectObject("service:tapestry.globals.HttpServletRequest")
public abstract HttpServletRequest getServletRequest();
and then do whatever with the HttpServletRequest
best regards.
Raul Raja.
Lindsay Steele wrote:
> getRequestCycle().getRequestContext().getRequest().getRemoteAddr();
>
> works for me - but throws deprecation warnings. Happy to see if anyone
> suggests something better.
>
> Adam Zimowski wrote:
>> Mornin'
>>
>> I need to obtain IP address from the requester of the page. With
>> Servlet API I'd use HttpServletRequest getRemoteAddr().
>>
>> I checked WebRequest interface in Tapestry and do not see the
>> equivalent. Anyone knows how to get this information?
>>
>> Thank You
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
Re: What is Tapestry's equivalent of getRemoteAddr() ?
Posted by Lindsay Steele <ls...@iinet.net.au>.
getRequestCycle().getRequestContext().getRequest().getRemoteAddr();
works for me - but throws deprecation warnings. Happy to see if anyone
suggests something better.
Adam Zimowski wrote:
> Mornin'
>
> I need to obtain IP address from the requester of the page. With
> Servlet API I'd use HttpServletRequest getRemoteAddr().
>
> I checked WebRequest interface in Tapestry and do not see the
> equivalent. Anyone knows how to get this information?
>
> Thank You
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
RE: What is Tapestry's equivalent of getRemoteAddr() ?
Posted by James Carman <ja...@carmanconsulting.com>.
You can actually access the HttpServletRequest object via HiveMind. Are you
using Tapestry 4? Then, you inject the service
"tapestry.globals.HttpServletRequest" into your page/component.
-----Original Message-----
From: Adam Zimowski [mailto:zimowski74@gmail.com]
Sent: Sunday, February 26, 2006 12:10 PM
To: Tapestry users
Subject: What is Tapestry's equivalent of getRemoteAddr() ?
Mornin'
I need to obtain IP address from the requester of the page. With
Servlet API I'd use HttpServletRequest getRemoteAddr().
I checked WebRequest interface in Tapestry and do not see the
equivalent. Anyone knows how to get this information?
Thank You
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org