You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Jeevan Bihari <je...@yahoo.com> on 2003/03/13 06:48:20 UTC

Session transfer between Tapestry and non-Tapestry app

  Let's say I have two web apps running on one application server. One of the apps is a Tapestry
one while the other is using a different framework. If I transfer the session from the
non-Tapestry app to the Tapestry app, is there a way for me to retrieve information from the
passed session in the latter ?

Thanks,
Jeevan

__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

Re: Session transfer between Tapestry and non-Tapestry app

Posted by Stav <cc...@yahoo.com>.
Yes.

This is easily done. Extend the HomeService with your
own custom class then override the service method.

Extract the data from the session and dump them in
your own Visit object implementation.

A snap shot of what I did is below:

----------------snip-------------------

    public boolean service(IEngineServiceView engine,
IRequestCycle cycle, ResponseOutputStream output)
            throws RequestCycleException,
ServletException, IOException {
        Visit visit = (Visit)(engine.getVisit(cycle));

        if(visit==null) {
            logger.debug(">>>> Visit is NOT NULL -
something is really wrong!!! <<<<");
        }
        HttpSession session =
(cycle.getRequestContext()).getSession();
        HttpServletRequest request =
(cycle.getRequestContext()).getRequest();
        
        // here you would extract your session
variables and populate
        // you custom Visit object.
        
        
        return super.service(engine, cycle, output);
    }

--------------end snip--------------------------

Don't for get to specify your custom HomeService in
your application spec.

Cheers,
Stav.


--- Jeevan Bihari <je...@yahoo.com> wrote:
>   Let's say I have two web apps running on one
> application server. One of the apps is a Tapestry
> one while the other is using a different framework.
> If I transfer the session from the
> non-Tapestry app to the Tapestry app, is there a way
> for me to retrieve information from the
> passed session in the latter ?
> 
> Thanks,
> Jeevan
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail:
> tapestry-user-help@jakarta.apache.org
> 


__________________________________________________
Do you Yahoo!?
Yahoo! Web Hosting - establish your business online
http://webhosting.yahoo.com

Re: Session transfer between Tapestry and non-Tapestry app

Posted by Richard Lewis-Shell <rl...@mac.com>.
Sure can.  The IRequestContext is a facade for the usual servlet API 
stuff - session, request, response etc. so if you put stuff in the 
session (or request?) you can grab it from your Tapestry app anywhere 
you have an IRequestContext.  We use this (in reverse) to pass info 
from our Tapestry app to a colocated servlet from a 3rd party 
framework.  HTH

Richard

On Thursday, March 13, 2003, at 06:48  PM, Jeevan Bihari wrote:

>   Let's say I have two web apps running on one application server. One 
> of the apps is a Tapestry
> one while the other is using a different framework. If I transfer the 
> session from the
> non-Tapestry app to the Tapestry app, is there a way for me to 
> retrieve information from the
> passed session in the latter ?
>
> Thanks,
> Jeevan
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Web Hosting - establish your business online
> http://webhosting.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>