cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Salvatore Incandela" <>
Subject Problems with requestAttributeSelector
Date Tue, 25 Jul 2006 16:15:36 GMT
Hi! I'm newbie to cocoon...
I've a problem with the request attribute selector.
Considering that i'm very unskilled...this is the problem:

A login page (login.html) with a simple input form, call in the action
parameter ->"login" :

<form action="login" method="post">
         <td align="right">User:</td>
         <td align="left"><input type="text" name="user"/></td>
         <td align="right">Password:</td>
         <td align="left"><input type="password" name="pass"/></td>
         <td colspan="2" align="center"><input type="submit"
This "login" is mapped in the sitemap, the generator call login.xsp,
well...the login.xsp verify the pwd and username, and send by the request
an attribute "flag" (a String that can be false or true depending if the pwd
is right!).

<map:selectors default="browser"/>
        <map:selectors default="request-attribute">
            <map:selector name="request-attribute" logger="
sitemap.selector.request-attribute" src="

    <map:match pattern="login.html">
                <map:read mime-type="text/html" src="content/login.html"/>
            <map:match pattern="login">
                <map:generate type="serverpages" src="xsp/login.xsp"/>

                 <map:select type="request-attribute">
                    <map:parameter name="attribute-name" value="flag"/>
                    <map:when test="true">
                        <map:transform type="xslt"
                        <map:redirect-to uri="login.html"/>
                <map:serialize type="html"/>
the login.xsp

String flag= new String("false");
 String user = <xsp-request:get-parameter name="user"/>;
 String pwd = <xsp-request:get-parameter name="pass"/>;

 if (user.equals("test") &amp;&amp; pwd.equals("a")) {
    flag = "true";
 } else {
    flag= "false";


The selector appear that can't see the request's attribute, because it do
only the otherwise tag freely the flag value...
There is anyone that would to help me??????

View raw message