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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to