Accessing ServletContext, HttpServletRequest, HttpSession in Tapestry 4 applications

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accessing ServletContext, HttpServletRequest, HttpSession in Tapestry 4 applications

Michael Harhen
I am working on an application that requires coexistence of Tapestry and
Struts/Tiles. I need direct access to the ServletContext,
HttpServletRequest, and HttpSession from  a custom component.
Unfortunately, access to the HttpServletRequest has been deprecated in
Tapestry 4, and I cannot find any way to access the ServletContext. Is
there a supported Tapestry 4 method to accomplish this?

Thanks
Michael



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Accessing ServletContext, HttpServletRequest, HttpSession in Tapestry 4 applications

Howard Lewis Ship
You can access them, for the moment, via the requestCycle as in 3.0.

A better option is to inject service:tapestry.globals.HttpServletRequest or
service:tapestry.globals.HttpServletResponse.

Alternately, you can use the generic wrappers (WebRequest and WebResponse,
but they'll have all the functionality you'll likely need) and inject
infrastructure:request or infrastructure:response.

On 5/18/05, Michael Harhen <[hidden email]> wrote:

>
> I am working on an application that requires coexistence of Tapestry and
> Struts/Tiles. I need direct access to the ServletContext,
> HttpServletRequest, and HttpSession from a custom component.
> Unfortunately, access to the HttpServletRequest has been deprecated in
> Tapestry 4, and I cannot find any way to access the ServletContext. Is
> there a supported Tapestry 4 method to accomplish this?
>
> Thanks
> Michael
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>


--
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

Professional Tapestry training, mentoring, support
and project work. http://howardlewisship.com
Reply | Threaded
Open this post in threaded view
|

Re: Accessing ServletContext, HttpServletRequest, HttpSession in Tapestry 4 applications

Michael Harhen
In reply to this post by Michael Harhen
Is there a way to access the ServletContext from a Tapestry application?
I am aware that you can use request.getSession().getServletContext()
when using Servlet 2.3. Is there an alternative for Servlet 2.2?

Thanks in advance.
Michael

------=_Part_2684_3588018.1116417184867
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

You can access them, for the moment, via the requestCycle as in 3.0.

A better option is to inject service:tapestry.globals.HttpServletRequest or=
=20
service:tapestry.globals.HttpServletResponse.

Alternately, you can use the generic wrappers (WebRequest and WebResponse,=
=20
but they'll have all the functionality you'll likely need) and inject=20
infrastructure:request or infrastructure:response.

On 5/18/05, Michael Harhen <[hidden email]> wrote:
 >=20
 > I am working on an application that requires coexistence of Tapestry and
 > Struts/Tiles. I need direct access to the ServletContext,
 > HttpServletRequest, and HttpSession from a custom component.
 > Unfortunately, access to the HttpServletRequest has been deprecated in
 > Tapestry 4, and I cannot find any way to access the ServletContext. Is
 > there a supported Tapestry 4 method to accomplish this?
 >=20
 > Thanks
 > Michael
 >=20
 > ---------------------------------------------------------------------
 > To unsubscribe, e-mail: [hidden email]
 > For additional commands, e-mail: [hidden email]
 >=20
 >=20


--=20
Howard M. Lewis Ship
Independent J2EE / Open-Source Java Consultant
Creator, Jakarta Tapestry
Creator, Jakarta HiveMind

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

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]