You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Enke Michael <Mi...@wincor-nixdorf.com> on 2001/08/22 15:00:36 UTC

Need help with session:set-attribute

Hello again,
I need some help with the session-logicsheet.
I try to set an attribute in a session
but I get always a compilation error.

Here is my xsp:
<?xml version="1.0" encoding="UTF-8"?>
 
<xsp:page language="java"
  xmlns:xsp="http://apache.org/xsp"
  xmlns:session="http://apache.org/xsp/session/2.0"
>
 
<page>
 <session-id><session:get-id/></session-id>
 
 <session:set-attribute name="fruit">apple</session:set-attribute>
 <session:invalidate/>
</page>
</xsp:page>

I create a session, try to set an attribute and destroy the session.
In the generted java file I see:
...
    XSPRequestHelper.setSessionAttribute(objectModel,
                                         String.valueOf("fruit"),
                                         this.characters("apple");
                                        )
...

For shure the semicolon must move behind the last right parenthesis.
As I saw, the session.xsl didn't change since May so this must be my
fault.
But where???

Regards,
Michael

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

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


Re: Need help with session:set-attribute

Posted by Enke Michael <Mi...@wincor-nixdorf.com>.
Ok, thanks for the tip.
The problem was the timestamp on the session.xsl
soo the build.sh didn't recognize that src/.../session.xsl
was newer than build/cocoon/src/.../session.xsl
which had no ";"

Michael


Vadim Gritsenko wrote:
> 
> Enke,
> 
> Check session.xsl in cocoon.jar:
>   <xsl:template match="session:set-attribute">
> ....
>     <xsp:logic>
>       XSPRequestHelper.setSessionAttribute(objectModel,
>         String.valueOf(<xsl:copy-of select="$name"/>),
>         <xsl:copy-of select="$content"/>
>       );
>     </xsp:logic>
>   </xsl:template>
> 
> Note: there is ";" after setSessionAttribute. If your copy does not have one - it's time to upgrade.
> 
> Vadim
> 
> > -----Original Message-----
> > From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> > Sent: Wednesday, August 22, 2001 10:27 AM
> > To: cocoon-users@xml.apache.org
> > Subject: Re: Need help with session:set-attribute
> >
> >
> > Ok, if I do this, I get also an error.
> > Now there is the semicolon missing!
> > The java file looks like:
> > ...
> >     XSPObjectHelper.xspExpr(contentHandler,
> >                             XSPRequestHelper.getSessionId(objectModel));
> >
> >
> >     this.contentHandler.endElement("", "session-id", "session-id");
> >
> >
> >     this.characters("\n\n ");
> >
> >     XSPRequestHelper.setSessionAttribute(objectModel,
> >                                          String.valueOf("fruit"),
> >
> >                                          ("apple")
> >                                         )
> >     this.characters("\n ");
> >
> >     XSPRequestHelper.invalidateSession(objectModel);
> > ...
> >
> > Michael
> >
> > Vadim Gritsenko wrote:
> > >
> > > Try
> > > <session:set-attribute name="fruit"><xsp:expr>"apple"</xsp:expr></session:set-attribute>
> > >
> > > Vadim
> > >
> > > > -----Original Message-----
> > > > From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> > > > Sent: Wednesday, August 22, 2001 9:01 AM
> > > > To: cocoon-users@xml.apache.org
> > > > Subject: Need help with session:set-attribute
> > > >
> > > >
> > > > Hello again,
> > > > I need some help with the session-logicsheet.
> > > > I try to set an attribute in a session
> > > > but I get always a compilation error.
> > > >
> > > > Here is my xsp:
> > > > <?xml version="1.0" encoding="UTF-8"?>
> > > >
> > > > <xsp:page language="java"
> > > >   xmlns:xsp="http://apache.org/xsp"
> > > >   xmlns:session="http://apache.org/xsp/session/2.0"
> > > > >
> > > >
> > > > <page>
> > > >  <session-id><session:get-id/></session-id>
> > > >
> > > >  <session:set-attribute name="fruit">apple</session:set-attribute>
> > > >  <session:invalidate/>
> > > > </page>
> > > > </xsp:page>
> > > >
> > > > I create a session, try to set an attribute and destroy the session.
> > > > In the generted java file I see:
> > > > ...
> > > >     XSPRequestHelper.setSessionAttribute(objectModel,
> > > >                                          String.valueOf("fruit"),
> > > >                                          this.characters("apple");
> > > >                                         )
> > > > ...
> > > >
> > > > For shure the semicolon must move behind the last right parenthesis.
> > > > As I saw, the session.xsl didn't change since May so this must be my
> > > > fault.
> > > > But where???
> > > >
> > > > Regards,
> > > > Michael
> > > >
> > > > ---------------------------------------------------------------------
> > > > Please check that your question has not already been answered in the
> > > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > > >
> > > > To unsubscribe, e-mail: <co...@xml.apache.org>
> > > > For additional commands, e-mail: <co...@xml.apache.org>
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > Please check that your question has not already been answered in the
> > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail: <co...@xml.apache.org>
> > > For additional commands, e-mail: <co...@xml.apache.org>
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

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

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


RE: Need help with session:set-attribute

Posted by Vadim Gritsenko <vg...@hns.com>.
Enke,

Check session.xsl in cocoon.jar:
  <xsl:template match="session:set-attribute">
....
    <xsp:logic>
      XSPRequestHelper.setSessionAttribute(objectModel,
        String.valueOf(<xsl:copy-of select="$name"/>),
        <xsl:copy-of select="$content"/>
      );
    </xsp:logic>
  </xsl:template>

Note: there is ";" after setSessionAttribute. If your copy does not have one - it's time to upgrade.

Vadim

> -----Original Message-----
> From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> Sent: Wednesday, August 22, 2001 10:27 AM
> To: cocoon-users@xml.apache.org
> Subject: Re: Need help with session:set-attribute
> 
> 
> Ok, if I do this, I get also an error.
> Now there is the semicolon missing!
> The java file looks like:
> ...
>     XSPObjectHelper.xspExpr(contentHandler,
>                             XSPRequestHelper.getSessionId(objectModel));
>  
>  
>     this.contentHandler.endElement("", "session-id", "session-id");
>  
>  
>     this.characters("\n\n ");
>  
>     XSPRequestHelper.setSessionAttribute(objectModel,
>                                          String.valueOf("fruit"),
>  
>                                          ("apple")
>                                         )
>     this.characters("\n ");
>  
>     XSPRequestHelper.invalidateSession(objectModel);
> ...
> 
> Michael
> 
> Vadim Gritsenko wrote:
> > 
> > Try
> > <session:set-attribute name="fruit"><xsp:expr>"apple"</xsp:expr></session:set-attribute>
> > 
> > Vadim
> > 
> > > -----Original Message-----
> > > From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> > > Sent: Wednesday, August 22, 2001 9:01 AM
> > > To: cocoon-users@xml.apache.org
> > > Subject: Need help with session:set-attribute
> > >
> > >
> > > Hello again,
> > > I need some help with the session-logicsheet.
> > > I try to set an attribute in a session
> > > but I get always a compilation error.
> > >
> > > Here is my xsp:
> > > <?xml version="1.0" encoding="UTF-8"?>
> > >
> > > <xsp:page language="java"
> > >   xmlns:xsp="http://apache.org/xsp"
> > >   xmlns:session="http://apache.org/xsp/session/2.0"
> > > >
> > >
> > > <page>
> > >  <session-id><session:get-id/></session-id>
> > >
> > >  <session:set-attribute name="fruit">apple</session:set-attribute>
> > >  <session:invalidate/>
> > > </page>
> > > </xsp:page>
> > >
> > > I create a session, try to set an attribute and destroy the session.
> > > In the generted java file I see:
> > > ...
> > >     XSPRequestHelper.setSessionAttribute(objectModel,
> > >                                          String.valueOf("fruit"),
> > >                                          this.characters("apple");
> > >                                         )
> > > ...
> > >
> > > For shure the semicolon must move behind the last right parenthesis.
> > > As I saw, the session.xsl didn't change since May so this must be my
> > > fault.
> > > But where???
> > >
> > > Regards,
> > > Michael
> > >
> > > ---------------------------------------------------------------------
> > > Please check that your question has not already been answered in the
> > > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > >
> > > To unsubscribe, e-mail: <co...@xml.apache.org>
> > > For additional commands, e-mail: <co...@xml.apache.org>
> > >
> > >
> > 
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> > 
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 

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

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


Re: Need help with session:set-attribute

Posted by Enke Michael <Mi...@wincor-nixdorf.com>.
Ok, if I do this, I get also an error.
Now there is the semicolon missing!
The java file looks like:
...
    XSPObjectHelper.xspExpr(contentHandler,
                            XSPRequestHelper.getSessionId(objectModel));
 
 
    this.contentHandler.endElement("", "session-id", "session-id");
 
 
    this.characters("\n\n ");
 
    XSPRequestHelper.setSessionAttribute(objectModel,
                                         String.valueOf("fruit"),
 
                                         ("apple")
                                        )
    this.characters("\n ");
 
    XSPRequestHelper.invalidateSession(objectModel);
...

Michael

Vadim Gritsenko wrote:
> 
> Try
> <session:set-attribute name="fruit"><xsp:expr>"apple"</xsp:expr></session:set-attribute>
> 
> Vadim
> 
> > -----Original Message-----
> > From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> > Sent: Wednesday, August 22, 2001 9:01 AM
> > To: cocoon-users@xml.apache.org
> > Subject: Need help with session:set-attribute
> >
> >
> > Hello again,
> > I need some help with the session-logicsheet.
> > I try to set an attribute in a session
> > but I get always a compilation error.
> >
> > Here is my xsp:
> > <?xml version="1.0" encoding="UTF-8"?>
> >
> > <xsp:page language="java"
> >   xmlns:xsp="http://apache.org/xsp"
> >   xmlns:session="http://apache.org/xsp/session/2.0"
> > >
> >
> > <page>
> >  <session-id><session:get-id/></session-id>
> >
> >  <session:set-attribute name="fruit">apple</session:set-attribute>
> >  <session:invalidate/>
> > </page>
> > </xsp:page>
> >
> > I create a session, try to set an attribute and destroy the session.
> > In the generted java file I see:
> > ...
> >     XSPRequestHelper.setSessionAttribute(objectModel,
> >                                          String.valueOf("fruit"),
> >                                          this.characters("apple");
> >                                         )
> > ...
> >
> > For shure the semicolon must move behind the last right parenthesis.
> > As I saw, the session.xsl didn't change since May so this must be my
> > fault.
> > But where???
> >
> > Regards,
> > Michael
> >
> > ---------------------------------------------------------------------
> > Please check that your question has not already been answered in the
> > FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> >
> > To unsubscribe, e-mail: <co...@xml.apache.org>
> > For additional commands, e-mail: <co...@xml.apache.org>
> >
> >
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>

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

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


RE: Need help with session:set-attribute

Posted by Drasko Kokic <dr...@yahoo.com>.
would anybody know how to get the session object in
C2?
I would need to pass it to some java methods :-(

--- Vadim Gritsenko <vg...@hns.com> wrote:
> Try
> <session:set-attribute
>
name="fruit"><xsp:expr>"apple"</xsp:expr></session:set-attribute>
> 
> Vadim
> 
> > -----Original Message-----
> > From: Enke Michael
> [mailto:Michael.Enke@wincor-nixdorf.com]
> > Sent: Wednesday, August 22, 2001 9:01 AM
> > To: cocoon-users@xml.apache.org
> > Subject: Need help with session:set-attribute
> > 
> > 
> > Hello again,
> > I need some help with the session-logicsheet.
> > I try to set an attribute in a session
> > but I get always a compilation error.
> > 
> > Here is my xsp:
> > <?xml version="1.0" encoding="UTF-8"?>
> >  
> > <xsp:page language="java"
> >   xmlns:xsp="http://apache.org/xsp"
> >  
> xmlns:session="http://apache.org/xsp/session/2.0"
> > >
> >  
> > <page>
> >  <session-id><session:get-id/></session-id>
> >  
> >  <session:set-attribute
> name="fruit">apple</session:set-attribute>
> >  <session:invalidate/>
> > </page>
> > </xsp:page>
> > 
> > I create a session, try to set an attribute and
> destroy the session.
> > In the generted java file I see:
> > ...
> >    
> XSPRequestHelper.setSessionAttribute(objectModel,
> >                                         
> String.valueOf("fruit"),
> >                                         
> this.characters("apple");
> >                                         )
> > ...
> > 
> > For shure the semicolon must move behind the last
> right parenthesis.
> > As I saw, the session.xsl didn't change since May
> so this must be my
> > fault.
> > But where???
> > 
> > Regards,
> > Michael
> > 
> >
>
---------------------------------------------------------------------
> > Please check that your question has not already
> been answered in the
> > FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
> > 
> > To unsubscribe, e-mail:
> <co...@xml.apache.org>
> > For additional commands, e-mail:
> <co...@xml.apache.org>
> > 
> > 
> 
>
---------------------------------------------------------------------
> Please check that your question has not already been
> answered in the
> FAQ before posting.
> <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail:
> <co...@xml.apache.org>
> For additional commands, e-mail:
> <co...@xml.apache.org>
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

RE: Need help with session:set-attribute

Posted by Vadim Gritsenko <vg...@hns.com>.
Try
<session:set-attribute name="fruit"><xsp:expr>"apple"</xsp:expr></session:set-attribute>

Vadim

> -----Original Message-----
> From: Enke Michael [mailto:Michael.Enke@wincor-nixdorf.com]
> Sent: Wednesday, August 22, 2001 9:01 AM
> To: cocoon-users@xml.apache.org
> Subject: Need help with session:set-attribute
> 
> 
> Hello again,
> I need some help with the session-logicsheet.
> I try to set an attribute in a session
> but I get always a compilation error.
> 
> Here is my xsp:
> <?xml version="1.0" encoding="UTF-8"?>
>  
> <xsp:page language="java"
>   xmlns:xsp="http://apache.org/xsp"
>   xmlns:session="http://apache.org/xsp/session/2.0"
> >
>  
> <page>
>  <session-id><session:get-id/></session-id>
>  
>  <session:set-attribute name="fruit">apple</session:set-attribute>
>  <session:invalidate/>
> </page>
> </xsp:page>
> 
> I create a session, try to set an attribute and destroy the session.
> In the generted java file I see:
> ...
>     XSPRequestHelper.setSessionAttribute(objectModel,
>                                          String.valueOf("fruit"),
>                                          this.characters("apple");
>                                         )
> ...
> 
> For shure the semicolon must move behind the last right parenthesis.
> As I saw, the session.xsl didn't change since May so this must be my
> fault.
> But where???
> 
> Regards,
> Michael
> 
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
> 
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>
> 
> 

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

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