cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <c.h...@web.de>
Subject Re: DatabaseUpdateAction and "{session-attr:custid}
Date Fri, 16 Apr 2004 07:53:42 GMT
Stefan Geelen wrote:
> Hi,
> I posted this question a month ago or so but did not get any reaction.
>  
> I hope I've more luck now...
>  
> Basically the question is: How can I passs the a session attribute to  a 
> DatabaseUpdateAction ?
>  
>  
> More info below:
> 
> I have following in my sitemap:
> 
> <map:action name= "mod-db-upd "
> src= "org.apache.cocoon.acting.modular.DatabaseUpdateAction " >
> 
> <descriptor >context://test/database/database-descriptor.xml </descriptor >
> <throw-exception >true </throw-exception >
> </map:action >
> 
> and
> 
> <!-- -- >
> <!-- Update myaccount/myaccount-update-custinfo -- >
> <!-- -- >
> <map:pipeline >
> <map:match pattern= "myaccount/myaccount-update-custinfo.act " >
> <map:act type= "mod-db-upd " >
> <map:parameter name= "table-set " value= "customers "/ >
> <map:parameter name= "custid " value= "{session-attr:custid} "/ >
> <map:redirect-to uri= "info.act "/ >
> </map:act >
> <map:redirect-to uri= "update-failed.content "/ >
> </map:match >
> </map:pipeline >
> 
> 
> I would like to pass the custid (kept in the session) to the action:
> 
> <map:parameter name= "custid " value= "{session-attr:custid} "/ >

You can't pass any data to be stored through the sitemap to the action.
All data needs to be accessible through an input module. Fortunately, there
is a module to access session attributes (or any request property).
You need to wire that module (and some parameters like attribute name)
in the database-descriptor.xml

HTH
	Chris.

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


Mime
View raw message