An XML file is being posted to a url that my spring mvc is responding to.
In .NET, I could do this:
request.Form[0]
request.Form["abc"]
or
request.QueryString[0]
request.QueryString["some_key"]
Now with spring/servlets it seems I can only do this:
request.getParameter("some_key")
or get all the names or values.
When someone is posting a file to a url, using http post, won’t this be just a single request parameter then?
Can I get the parameter using index with servlets?
Not necessarily. If the form contains more fields, then we’d have more parameters.
AFAIK, No.
request.getParameter()doesn’t return an array or a collection. So can’t do that withrequest.getParameter()request.getParameterValues(String)returns an array – but only the values associated with the given parameter namerequest.getParameterMap()works on keys, and not ordered. That won’t help either.