Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Why is this syntax illegal: ${ paramValues ["attribname"] [0] ?  RSS feed

 
John Strong
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EL implicit objects are map objects that we can index associatively. In other words, the following is legal:

${requestScope["attribname"]}, where "attribname" is the name of a request-scope attribute.

Also, ${paramValues.attribname[0]} works just fine, when "attribname" is a multi-valued attribute (i.e. an attribute whose value is an array of strings).

But when I try ${paramValues["attribname"][0]}, I get a runtime error. Why?

- John Strong (pluviosilla@gmail.com)
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine for me.

Please follow forum instructions and include the container you are using, and what versions of JSP/JSTL.

Also, it would help to actually show the error message.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!