• Post Reply Bookmark Topic Watch Topic
  • New Topic

Problem with JSTL

 
Bharadwaj Adepu
Ranch Hand
Posts: 99
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a Problem with JSP, regarding JSTL and EL Functions.

Am retrieving values from the database in a bean and storing it in a ArrayList and getting this list in the JSP, the problem am facing is, this list is returning the values in square brackets.
This is the code

This prints the following output


This has to print



Why is this returning the values within square brackets? and spaces before each list item?
 
Steve Luke
Bartender
Posts: 4181
22
IntelliJ IDE Java Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The most likely candidate is where you assign or create taskList. Can you show us how you do that? It appears to me like the task list was originally an array and you assigned it to a String which would produce a String like: "[item1, item2, item3]". Then when you iterate over taskList it is parsing the String on commas and you get the results you have. But that is hard to be sure without code.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!