hi Yves
try to write your xml without change lines between elements
<xsp-cookie:getValue><xsp-cookie:name><xsp:expr>parent_role</xsp:expr></xsp-cookie:name></xsp-cookie:getValue>
On Sun, 3 Apr 2005, Yves Vindevogel wrote:
> I can't get this to work. The first part, setting the cookies, works.
> Or compiles at least.
> The second part, getting the cookies, fails with a compile error.
>
> This is part of my code
> (Setting the cookie)
>
>
> <esql:execute-query>
>
> <esql:query>select * from tblUsers where login =
> '<xsp-request:get-parameter name="txtUsername"/>'</esql:query>
>
>
>
> <esql:results>
>
> <esql:row-results>
>
> <p>Welcome <b><esql:get-string
> column="username"/></b>,</p>
>
> <p>You now have access to the reports on the
> database
> "<b><esql:get-string column="dbase"/></b>".</p>
>
> <p>Click <a href="./reports.xsp">here</a>to
> go to the
> report selection.</p>
>
> </esql:row-results>
>
>
> <xsp-cookie:create-cookies>
>
> <xsp-cookie:cookie name="dbase">
>
> <xsp-cookie:value>test</xsp-cookie:value>
>
> </xsp-cookie:cookie>
>
> </xsp-cookie:create-cookies>
>
>
> </esql:results>
>
> </esql:execute-query>
>
>
> (Reading the cookie)
>
> <div id="divLogo" style="position: absolute; right:
> 20px; top: 10px;
> width: 200px; text-align: right">
> <xsp-cookie:getValue name="dbase"/>
>
>
> <img src="images/logo.gif"/>
> </div>
>
>
> (Error message)
>
> org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error
> compiling reports_xsp: ERROR 1
> (org/apache/cocoon/www/pdt/xsp/reports_xsp.java): ...
> this.characters("\n\t\t\t\t"); XSPCookieHelper.getValue(objectModel,
> "dbase" , -1) // start error (lines 431-431) "Syntax error on keyword
> "this"; "=", "*=", "/=", "%=", "+=", "-=", "<<=", ">>=", ">>>=", "&=",
> "^=", "|=", "++", "--" expected"
> this.characters("\t\t\t\t\t\t\t\t\t\t\t"); // end error
> this.characters("\n\t\t\t\t"); this.characters("\n\t\t\t\t"); ... Line
> 431, column 0: Syntax error on keyword "this"; "=", "*=", "/=", "%=",
> "+=", "-=", "<<=", ">>=", ">>>=", "&=", "^=", "|=", "++", "--" expected
>
>
> >
>
> On 01 Apr 2005, at 17:55, [EMAIL PROTECTED] wrote:
>
> >
> > hi Yves
> >
> > a simple code fragment in XSP
> >
> > ...
> > <xsp:logic>
> > String parent_role = <xsp-request:get-parameter
> > name="parent_role"/>;
> > String parent_id = <xsp-request:get-parameter
> > name="parent_id"/>;
> >
> > if (parent_id==null){
> > parent_id =
> > <xsp:expr>
> > <xsp-cookie:getValue>
> >
> > <xsp-cookie:name>
> >
> > <xsp:expr>parent_role</xsp:expr>
> >
> > </xsp-cookie:name>
> > </xsp-cookie:getValue>
> >
> > </xsp:expr>;
> >
> > <role><xsp:expr>parent_id</xsp:expr></role>
> >
> > }else{
> > <xsp-cookie:create-cookies>
> > <xsp-cookie:cookie>
> > <xsp-cookie:name>
> > <xsp:expr>parent_role</xsp:expr>
> > </xsp-cookie:name>
> > <xsp-cookie:value>
> > <xsp:expr>parent_id</xsp:expr>
> > </xsp-cookie:value>
> > </xsp-cookie:cookie>
> > </xsp-cookie:create-cookies>
> > }
> > </xsp:logic>
> >
> > ...
> >
> > be carefull to declare namespaces
> > <xsp:page language="java" xmlns:xsp="http://apache.org/xsp"
> > xmlns:esql="http://apache.org/cocoon/SQL/v2"
> > xmlns:xsp-request="http://apache.org/xsp/request/2.0"
> > xmlns:xsp-cookie="http://apache.org/xsp/cookie/2.0">
> >
> > this is an 2 years old implementation in XSP i have found in my disk
> > that
> > work
> >
> > i'll suggest you to use flow instead of XSP (but this depends of your
> > needs)
> >
> >
> > http://cocoon.apache.org/2.1/userdocs/flow/api.html
> > http://cocoon.apache.org/2.1/userdocs/flow/api.html#Cookie+Object
> >
> > regards
> >
> > stavros
> >
> >
> > On Fri, 1 Apr 2005, Yves Vindevogel wrote:
> >
> >> Hi,
> >>
> >> Where can I find a newbie example on how to use cookies in cocoon ?
> >> I need to drop a cookie on the client and read it back ...
> >>
> >> Regards,
> >> Yves
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: [EMAIL PROTECTED]
> >> For additional commands, e-mail: [EMAIL PROTECTED]
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >
> >
> Met vriendelijke groeten,
> Bien ΰ vous,
> Kind regards,
>
> Yves Vindevogel
> Implements
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]