cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Grzegorz Kossakowski <gkossakow...@apache.org>
Subject Re: Iterate multiple request parameters in a map pipeline..?
Date Mon, 21 May 2007 14:46:04 GMT
ypomonh pisze:
> Jasha Joachimsthal wrote:
>> If you don't know which parameters you can expect, how will you handle
>> them?
> 
> It is trivial for a web app to not know exactly what parameters to expect.
> 
> As I learned from the mailing list a couple of days ago, for flowscript 
> you can do something similar to:
> 
> var map = new Packages.java.util.HashMap();
>      var namesEnumeration = cocoon.request.getParameterNames();
>    var name = null;
>    var value = null;
>      while (namesEnumeration.hasMoreElements() ) {
>        name = namesEnumeration.nextElement();
>        value = cocoon.request.get(name);
>        map.put(name, value);
>    }
> 
> Now you can iterate the map to get parameter name/value pairs, eg. print 
> them one-by-one :)

It depends what you are going to do with these parameters. If you want them included into
processed XML in the pipeline just use JX 
templates for iterating parameters and producing appropriate XML representation.

-- 
Grzegorz Kossakowski
http://reflectingonthevicissitudes.wordpress.com/

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


Mime
View raw message