jspel

EL how to access an array of request parameters in the JSP/view file


I have a request url like this

http://www.example.com/?q[]=a&q[]=b&q[]=c

In EL

${param['q[]']}

only gives me the first value of the array, which is "a" in this case. How to get "b", "c" from the request parameter? And ideally is there a way to get the reference to the "q[]" array so that I can iterate through it ?


Solution

  • From http://docs.oracle.com/javaee/1.4/tutorial/doc/JSPIntro7.html#wp71043 (first link when googling for JSP EL):

    paramValues: Maps a request parameter name to an array of values