Changeset 3599


Ignore:
Timestamp:
2002-12-02T09:50:02+13:00 (21 years ago)
Author:
kjdon
Message:

servlet now handles params with multiple values - needed for from queries.
the param values are also made xml-attribute safe - &<>'" are escaped out

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl3/src/java/org/greenstone/gsdl3/LibraryServlet.java

    r3578 r3599  
    109109        String name = (String)params.nextElement();
    110110        if (!name.equals("a") && !name.equals("sa") && !name.equals("l")) { // these ones are in the header so leave out
    111             String value = request.getParameter(name);
    112             // for now, just add value as attribute - should un-url
    113             // encode them etc and so some might need to be text not
    114             // atts or is that done already?
    115             xml_request += "<param name='"+name+"' value='"+value+"'/>";
     111            String value="";
     112            String []values = request.getParameterValues(name);
     113            value = values[0];
     114            if (values.length > 1) {
     115            for (int i=1; i< values.length; i++) {
     116                value += ","+values[i];
     117            }
     118            }
     119            xml_request += "<param name='"+name+"' value='"+GSXML.xmlSafe(value)+"'/>";
     120           
    116121        }
    117122        }
Note: See TracChangeset for help on using the changeset viewer.