cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vadim Gritsenko" <vgritse...@yahoo.com>
Subject RE: Using Selectors
Date Mon, 17 Sep 2001 13:53:47 GMT
I think you need to move use different syntax:

> 				<parameter-name>crudlet.login.action"</parameter-name>

And/or move parameter declaration to different place:

> 		<map:resource name="do-login">
> 			<map:select type="form-submitted"> <!-- **** test not working **** -->
> 				<map:parameter name="parameter-name" value="crudlet.login.action"/>
> 				<map:when test="login">

Hope something of this will help.

Vadim

> -----Original Message-----
> From: Jeremy Quinn [mailto:jermq@media.demon.co.uk]
> Sent: Monday, September 17, 2001 9:21 AM
> To: cocoon-dev@xml.apache.org
> Subject: Using Selectors
> 
> 
> Dear All,
> 
> I am trying to use the RequestSelector, without much luck so far.
> 
> Can anyone confirm that <a> it works and <b> I am using it correctly.
> 
> 
> (sub)Sitemap snippet:
> 
> 	setup
> 
> 		<map:selectors default="browser">
> 			<!-- tests value of incoming form param 'crudlet.login.action' -->
> 			<map:selector name="form-submitted"
> src="org.apache.cocoon.selection.RequestSelectorFactory">
> 				<map:parameter name="parameter-name" value="crudlet.login.action"/>
> 			</map:selector>
> 		</map:selectors>
> 
> 	usage
> 
> 		<map:resource name="do-login">
> 			<map:select type="form-submitted"> <!-- **** test not working **** -->
> 				<map:when test="login">
> 					<!-- do a bunch of stuff -->
> 				</map:when>
> 				<map:otherwise> <!-- a login form was not submitted -->
> 					<map:act type="session-propagator">
> 						<map:parameter name="crudlet.login.state" value="timeout"/>
> 						<map:parameter name="crudlet.login.target" value="{target}"/>
> 					</map:act>
> 					<map:redirect-to resource="login-fs"/>
> 				</map:otherwise>
> 			</map:select>
> 			<map:redirect-to resource="login-fs"/>
> 		</map:resource>
> 
> This outputs code to my sitemap_xmap.java that appears it would not work
> (See the "null"s):
> 
> 
>   private boolean form_submittedSelect (String pattern,
>                                         Map objectModel, Parameters param) {
>     String compareToString = null;
>     if (param == null) {
>       compareToString = (String) XSPRequestHelper.getParameter(objectModel,
>                         "null",null);
>     } else {
>       compareToString = (String) XSPRequestHelper.getParameter(objectModel,
>                         param.getParameter("state-key","null"), null);
>     }
>     return compareToString != null && compareToString.equals (pattern);
>   }
> 
>  It does not appear to be picking up my request param name in the config.
> 
> 
> Any suggestions?
> 
> 
> thanks
> 
> regards Jeremy
> -- 
>    ___________________________________________________________________
> 
>    Jeremy Quinn                                           Karma Divers
>                                                        webSpace Design
>                                             HyperMedia Research Centre
> 
>    <mailto:sharkbait@mac.com>     		 <http://www.media.demon.co.uk>
>     <phone:+44.[0].20.7737.6831>        <pager:jermq@sms.genie.co.uk>
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: cocoon-dev-unsubscribe@xml.apache.org
> For additional commands, email: cocoon-dev-help@xml.apache.org
> 

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


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


Mime
View raw message