cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ypomonh <ypom...@freemail.gr>
Subject Re: Iterate multiple request parameters in a map pipeline..?
Date Mon, 21 May 2007 14:31:07 GMT
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 :)




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


Mime
View raw message