cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Martin Geissler" <M.Geiss...@wika.de>
Subject Antw: Re: Sessions (read please!)
Date Fri, 29 Nov 2002 14:47:30 GMT
Hello,
i don t use servlets but JSPs

have the following code:

1. xsp Document
  <xsp:structure>
    <xsp:include>org.apache.cocoon.environment.Session</xsp:include>
  </xsp:structure>
...
Session session = request.getSession (false);
		    if (session != null) {
		        // delet od session
		        session.invalidate ();
		    }
		    // create new session
		    session = request.getSession (true);
		    session.setAttribute ("props", properties);
		    session.setAttribute ("user", user);
                    session.setMaxInactiveInterval(3600); // 1 houer

...
2. Session in JSP page or xsp page
HTTPSession is a default class in a JSP page!(?)
<%
  HttpSession session = request.getSession (false);
  // When there's no session and no user object tell person in front of
the screen so
if (session != null && session.getAttribute ("user") != null) 
{

    User user = (User)session.getAttribute ("user");
}
else
{
...
}  

JSP in sitemap as JSPreader, not JSPgenerator, cause i first developed
JSPs and then changed to cocoon

hth

Martin Gei├čler

>>> mauro@altersoft.com.ar Freitag, 29. November 2002 15:15:10 >>>
Hi! third time.  I'm still stuck.  May be the subject is not
interesting,
or may be no one is working with cocoon, servlets and session
attributes.
HELP! (read below).

Thanks, and sorry for insisting.

-- Mauro

On Fri, 22 Nov 2002, Mauro Daniel Ardolino wrote:

> Hi again!  I'm still stuck.  I've tried a lot of things without
success.
> Does anyone work with cocoon and servlets, and session attributes?
> If so, please read below (my previous mail)! thanks!
> 
> -- Mauro
> 
> On Mon, 18 Nov 2002, Mauro Daniel Ardolino wrote:
> 
> > Hi! I have a problem using cocoon with other servlets.
> > I have a servlet that outputs a xml and then in a pipeline I apply
a xsl
> > transformation.  This works well, but this servlet needs a session
> > parameter.
> > 
> > Inside the servlet I wrote:
> > 
> > HttpSession session= request.getSession();
> > TreeMap cart= (TreeMap) session.getAttribute("cart")
> > 
> > But I cannot obtain the "cart" parameter.  If I put the "false"
parameter
> > to the request.getSession(), I obtain an exception.
> > 
> > So I have to think that cocoon is not passing the session to this
servlet.
> > I have to say that other servlet adds the "cart" parameter to the
session,
> > of course.
> > 
> > Here's a copy of the pipeline:
> > 
> > <map:match pattern="CheckoutPage.html">
> > 	<map:generate
src="http://delta:18080/ProductSelectionDemo1/checkoutPage"/> 
> > 	<map:transform src="style/CheckoutPage_html.xsl" type="xslt"/>
> > 	<map:serialize type="html"/>
> > </map:match>
> > 
> > Must I do something special to pass the session to this servlet?
> > (the servlet url is
"http://delta:18080/ProductSelectionDemo1/checkoutPage")
> > 
> > Thanks in advance.
> > 
> > -- Mauro
> > 
> > 
> 
> 

-- 
Ing.Mauro Daniel Ardolino
Departamento de Desarrollo y Servicios
Altersoft
Billinghurst 1599 - Piso 9
C1425DTE - Capital Federal
Tel/Fax: 4821-3376 / 4822-8759
mailto: mauro@altersoft.com.ar 
website: http://www.altersoft.com.ar 


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message