You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by beyaRecords - The home Urban music <uz...@beya-records.com> on 2004/01/05 20:02:28 UTC
Actions and map pipelines
hi,
i have looked through many documents now about actions and have found
nothing helpful. Could anyone show me how to reconstruct the following
into an action/map-xspaction document:
<xsp:logic>
// handle the previous page's values.
String name = <xsp-request:get-parameter name="name"/>;
String password = <xsp-request:get-parameter name="password"/>;
int userid;
<esql:connection>
<esql:dbpool>mypool</esql:dbpool>
<esql:execute-query>
<esql:query>SELECT userid FROM users
WHERE name=name
AND password=password</esql:query>
<esql:row-results>
<xsp:logic>
userid = <esql:get-int column="userid"/>
</xsp:logic>
</esql:row-results>
<esql:no-results>
<xsp-response:send-redirect url="/home"/>
</esql:no-results>
</esql:execute-query>
</esql:connection>
</xsp:logic>
So the logic is return a recordset containing a single column and
assign the value to a variable, but if the user does not exist then
redirect the user to another page
regards
Uzo
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org