You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by Massimo Lusetti <ml...@gmail.com> on 2007/02/15 10:51:02 UTC

T5: Accessing client IP address

In a very custom page which is only returning a byte stream, no
text/html output just binary, I need to have access to the IP value to
being able to verify some conditions, so i wish to have access to this
value through org.apache.tapestry.services.Request.

I know this is a very untypical usage of a Tapestry page and this
could open a debate on "where we stop" adding value from
HttpServletRequest to the Request wrapper but maybe this value could
be useful to some one else.

For the record i decided to use a Tapestry page and not going directly
with a servlet since i can access all the nifty features from Tapestry
IoC which has saved me a lot of typing and coding.

What do you think?

Regards
-- 
Massimo
http://meridio.blogspot.com

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


Re: T5: Accessing client IP address

Posted by andyhot <an...@di.uoa.gr>.
Massimo Lusetti wrote:
> On 2/15/07, Howard Lewis Ship <hl...@gmail.com> wrote:
>
>>  Adding a request to JIRA is not inappropriate, and less likely to get
>> misplaced than posting here.
>
> I fired a JIRA, TAPESTRY-1272.

We noticed! Jira sends those to the dev list automatically!
>
> Regards


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


Re: T5: Accessing client IP address

Posted by Massimo Lusetti <ml...@gmail.com>.
On 2/15/07, Howard Lewis Ship <hl...@gmail.com> wrote:

>  Adding a request to JIRA is not inappropriate, and less likely to get
> misplaced than posting here.

I fired a JIRA, TAPESTRY-1272.

Regards
-- 
Massimo
http://meridio.blogspot.com

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


Re: T5: Accessing client IP address

Posted by Andrea Chiumenti <ki...@gmail.com>.
why not tot store all browser info into the cookie ?

On 2/15/07, D&J Gredler <dj...@gmail.com> wrote:
>
> FWIW, the two Tap apps I've written have also needed access to the client
> IP, so maybe it's not all that uncommon...
>
>
> On 2/15/07, Howard Lewis Ship <hl...@gmail.com> wrote:
> >
> > I've been following YAGNI principles about adding method to Request
> > that shadow HttpServletRequest ... that is, waiting until there's a
> > specific need.  It's not just the couple of lines of
> > Request/RequestImpl, but also the creation of the corresponding tests.
> > Adding a request to JIRA is not inappropriate, and less likely to get
> > misplaced than posting here.
> >
> > On 2/15/07, Massimo Lusetti <ml...@gmail.com> wrote:
> > > In a very custom page which is only returning a byte stream, no
> > > text/html output just binary, I need to have access to the IP value to
> > > being able to verify some conditions, so i wish to have access to this
> > > value through org.apache.tapestry.services.Request.
> > >
> > > I know this is a very untypical usage of a Tapestry page and this
> > > could open a debate on "where we stop" adding value from
> > > HttpServletRequest to the Request wrapper but maybe this value could
> > > be useful to some one else.
> > >
> > > For the record i decided to use a Tapestry page and not going directly
> > > with a servlet since i can access all the nifty features from Tapestry
> > > IoC which has saved me a lot of typing and coding.
> > >
> > > What do you think?
> > >
> > > Regards
> > > --
> > > Massimo
> > > http://meridio.blogspot.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > > For additional commands, e-mail: dev-help@tapestry.apache.org
> > >
> > >
> >
> >
> > --
> > Howard M. Lewis Ship
> > TWD Consulting, Inc.
> > Independent J2EE / Open-Source Java Consultant
> > Creator and PMC Chair, Apache Tapestry
> > Creator, Apache HiveMind
> >
> > Professional Tapestry training, mentoring, support
> > and project work.  http://howardlewisship.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
>

Re: T5: Accessing client IP address

Posted by D&J Gredler <dj...@gmail.com>.
FWIW, the two Tap apps I've written have also needed access to the client
IP, so maybe it's not all that uncommon...


On 2/15/07, Howard Lewis Ship <hl...@gmail.com> wrote:
>
> I've been following YAGNI principles about adding method to Request
> that shadow HttpServletRequest ... that is, waiting until there's a
> specific need.  It's not just the couple of lines of
> Request/RequestImpl, but also the creation of the corresponding tests.
> Adding a request to JIRA is not inappropriate, and less likely to get
> misplaced than posting here.
>
> On 2/15/07, Massimo Lusetti <ml...@gmail.com> wrote:
> > In a very custom page which is only returning a byte stream, no
> > text/html output just binary, I need to have access to the IP value to
> > being able to verify some conditions, so i wish to have access to this
> > value through org.apache.tapestry.services.Request.
> >
> > I know this is a very untypical usage of a Tapestry page and this
> > could open a debate on "where we stop" adding value from
> > HttpServletRequest to the Request wrapper but maybe this value could
> > be useful to some one else.
> >
> > For the record i decided to use a Tapestry page and not going directly
> > with a servlet since i can access all the nifty features from Tapestry
> > IoC which has saved me a lot of typing and coding.
> >
> > What do you think?
> >
> > Regards
> > --
> > Massimo
> > http://meridio.blogspot.com
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> > For additional commands, e-mail: dev-help@tapestry.apache.org
> >
> >
>
>
> --
> Howard M. Lewis Ship
> TWD Consulting, Inc.
> Independent J2EE / Open-Source Java Consultant
> Creator and PMC Chair, Apache Tapestry
> Creator, Apache HiveMind
>
> Professional Tapestry training, mentoring, support
> and project work.  http://howardlewisship.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

Re: T5: Accessing client IP address

Posted by Howard Lewis Ship <hl...@gmail.com>.
I've been following YAGNI principles about adding method to Request
that shadow HttpServletRequest ... that is, waiting until there's a
specific need.  It's not just the couple of lines of
Request/RequestImpl, but also the creation of the corresponding tests.
 Adding a request to JIRA is not inappropriate, and less likely to get
misplaced than posting here.

On 2/15/07, Massimo Lusetti <ml...@gmail.com> wrote:
> In a very custom page which is only returning a byte stream, no
> text/html output just binary, I need to have access to the IP value to
> being able to verify some conditions, so i wish to have access to this
> value through org.apache.tapestry.services.Request.
>
> I know this is a very untypical usage of a Tapestry page and this
> could open a debate on "where we stop" adding value from
> HttpServletRequest to the Request wrapper but maybe this value could
> be useful to some one else.
>
> For the record i decided to use a Tapestry page and not going directly
> with a servlet since i can access all the nifty features from Tapestry
> IoC which has saved me a lot of typing and coding.
>
> What do you think?
>
> Regards
> --
> Massimo
> http://meridio.blogspot.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>


-- 
Howard M. Lewis Ship
TWD Consulting, Inc.
Independent J2EE / Open-Source Java Consultant
Creator and PMC Chair, Apache Tapestry
Creator, Apache HiveMind

Professional Tapestry training, mentoring, support
and project work.  http://howardlewisship.com

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