cocoon-users mailing list archives

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

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:transform>
           </map:when>
           <map:when test="UserOk">
             <map:transform type="xslt" src="xsl/error_User.xsl">
               <map:parameter name="errorUser"
               value="{session-attr:errorUser}" />
             </map:transform>
                  </map:when>
         </map:select>
         <map:serialize type="xml" />
       </map:match>



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.

thanks
Lionel






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


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


Mime
View raw message