cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lionel Crine <>
Subject trouble with session attribute
Date Mon, 28 Jul 2003 07:36:59 GMT

I've some trouble with session attribute. Here is what I try :

The sitemap:
      <map:match pattern="addUser">
         <map:generate type="MyGenerator" src="user.xml" />
         <map:transform type=MyTransformerAddUser" />
         <map:select type="session_selector">
           <map:parameter name="attribute-name" value="errorUser" />
           <map:when test="UserAlready">
             <map:transform type="xslt" src="xsl/error_User.xsl">
               <map:parameter name="errorUser"
               value="{session-attr:errorUser}" />
           <map:when test="UserOk">
             <map:transform type="xslt" src="xsl/error_User.xsl">
               <map:parameter name="errorUser"
               value="{session-attr:errorUser}" />
         <map:serialize type="xml" />

In MyTransformerAddUser,I manage the session like this :

public class IXIASOFTTransformerAddUser
extends AbstractDOMTransformer
implements Transformer, DOMBuilder.Listener, Composable, Disposable, 
Recyclable {

public void setup(SourceResolver resolver, Map objectModel, String src, 
Parameters par)
throws ProcessingException, SAXException, IOException {

this.session = null;
this.session = this.request.getSession();

private Document addUser(Document doc) {
if (!isUser) {
this.session.setAttribute("errorUser", "UserOk");
else {
this.session.setAttribute("errorUser", "UserAlready");

In the transformer, all is working fine.
But from the sitemap, tha session attribute errorUser is one time late.
For example, if errorUser is UserAlready the first time, I have to go 
throught the transformer twice if I want to set errorUser to UserOk.

Any Idea what's going on.

PS : I use cocoon 2.0.4. My transformer do not use cache.


Lionel CRINE
Société : 4DConcept
22 rue Etienne de Jouy 78353 JOUY EN JOSAS
Tel : Fax :

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message