cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tom Place" <trp...@cs.nott.ac.uk>
Subject RE: <xsp-session> : Bug with Cocoon? or Bug with programmer?
Date Tue, 12 Nov 2002 20:38:30 GMT
Thanks for everyone's help with this. I was using cocoon 2.03 and when I
downloaded a new copy, this bug seemed to disappear.

Thanks anyway!

Tom 

-----Original Message-----
From: Geoff Howard [mailto:cocoongeoff@yahoo.com] 
Sent: 12 November 2002 15:46
To: cocoon-users@xml.apache.org
Subject: RE: <xsp-session> : Bug with Cocoon? or Bug with programmer?

What version of cocoon are you using?

Geoff
--- Tom Place <trp99c@cs.nott.ac.uk> wrote:
> After searching the created "Java" file (apologies
> for my earlier
> mistake), the request helper is the only place it
> could be trying to set
> the variable.
> For example the following XSP (entire file) :
> 
>
+---------------------------------------------------------+
> <?xml version="1.0"?>
> 
> <xsp:page
>   xmlns:xsp="http://apache.org/xsp"
>  
>
xmlns:xsp-session="http://apache.org/xsp/session/2.0"
>   create-session="true">
> 
>   <page>
>     <xsp-session:set-attribute
> name="fruit">Apple</xsp-session:set-attribute>
>     <fruit><xsp-session:get-attribute
> name="fruit"/></fruit>
>   </page>
> 
> </xsp:page> 
>
+---------------------------------------------------------+
> 
> Generates the following Java
> 
>
+---------------------------------------------------------+
> public class test_xsp extends XSPGenerator {
> 
>   static {
>     dateCreated = 1037088922427L;
>     dependencies = new File[]{
>                    };
>   }
> 
>   /* Built-in parameters available for use */
>   // context    - ServletContext
>   // request    - HttpServletRequest
>   // response   - HttpServletResponse
>   // parameters - parameters defined in the sitemap
> 
>   /* User Class Declarations */
> 
> 
>   /**
>   * Generate XML data.
>   */
>   public void generate() throws SAXException,
> IOException,
>   ProcessingException {
> 
> 
> 
>     this.contentHandler.startDocument();
>     AttributesImpl xspAttr = new AttributesImpl();
> 
> 
> 
>     this.contentHandler.startPrefixMapping("xml",
> "http://www.w3.org/XML/1998/namespace");
> 
>     this.contentHandler.startPrefixMapping("xsp",
> "http://apache.org/xsp");
> 
>    
>
this.contentHandler.startPrefixMapping("xsp-session",
> "http://apache.org/xsp/session/2.0");
> 
> 
>     this.contentHandler.startElement("", "page",
> "page", xspAttr);
> 
>     xspAttr.clear();
> 
> 
>     this.characters("\n    ");
> 
>    
> XSPRequestHelper.setSessionAttribute(objectModel,
>                                         
> String.valueOf("fruit"),
>                                         
> this.characters("Apple");
>                                         );
> 
>     this.characters("\n    ");
> 
> 
>     this.contentHandler.startElement("", "fruit",
> "fruit", xspAttr);
> 
>     xspAttr.clear();
> 
> 
> 
>     XSPObjectHelper.xspExpr(contentHandler,
>  
> XSPRequestHelper.getSessionAttribute(objectModel,
>  
> String.valueOf("fruit"), ""));
> 
> 
>     this.contentHandler.endElement("", "fruit",
> "fruit");
> 
> 
>     this.characters("\n  ");
> 
> 
>     this.contentHandler.endElement("", "page",
> "page");
> 
> 
>     this.contentHandler.endPrefixMapping("xml");
> 
>     this.contentHandler.endPrefixMapping("xsp");
> 
>    
> this.contentHandler.endPrefixMapping("xsp-session");
> 
> 
>     this.contentHandler.endDocument();
>   }
> }
> 
>
+---------------------------------------------------------+
> 
> So as you can see from the above the only place it
> is possible creating
> the session variable is 
> XSPRequestHelper.setSessionAttribute(objectModel,
>                                         
> String.valueOf("fruit"),
>                                         
> this.characters("Apple");
>                                         );
> And this is where the rogue semicolon appears.
> 
> I can remove the rogue semicolon by creating the
> String "Apple" and
> reverencing that string through <xsp:expr> tags. But
> this leads to a
> nullPointerException.
> 
> I think that either I am being really dim with this
> or some powers that
> I can't control are at work here!
> 
> Thanks for everyone's help so far
> 
> Tom Place
> 
> 
>
---------------------------------------------------------------------
> 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>
> 


__________________________________________________
Do you Yahoo!?
U2 on LAUNCH - Exclusive greatest hits videos
http://launch.yahoo.com/u2

---------------------------------------------------------------------
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