You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Lars Huttar <la...@sil.org> on 2003/11/20 23:42:26 UTC

Syntax error in session.setAttribute code?

Hi all,
In Cocoon 2.1.2, I'm generating the following XSP code:

<xsp:page xmlns:xsp="http://apache.org/xsp"
    xmlns:session="http://apache.org/xsp/session/2.0"
    xmlns:action="http://apache.org/cocoon/action/1.0"
    create-session="true">
  <session:set-attribute name="userid">lars</session:set-attribute>
  <action:set-success/>
</xsp:page>

(That's all of it.)
When I try to run this page (using XSPAction) I get the following error:

...

      private Redirector actionRedirector;
      private Map actionResultMap;

// start error (lines 77-77) "Syntax error on token "(", "Identifier" expected"
      session.setAttribute(String.valueOf("userid"),
// end error
          "lars");

        /**
...

Can anybody figure out why the setAttribute line should give a syntax
error? Or how I can fix this? It looks right to me. The example
in the session logicsheet docs show the XSP page with

  <session:set-attribute name="fruit">Apple</session:set-attribute>

which is exactly like what I have (ignoring the change in
namespace prefix from "xsp-session" to "session").
These docs show the javascript code as

  session.setAttribute("fruit", "Apple");

which is very close to what is giving the error above.
Maybe I should just do it in Javascript instead of using the
session logicsheet?

Thanks for any help,
Lars


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