• Post Reply Bookmark Topic Watch Topic
  • New Topic

Arrays  RSS feed

 
Rune Thandy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to use arrays in JSP, but I don't know how.

How can I fill an array and use this data later on in the same page?
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can do the declaration and intialization in a scriptlet:

and then use the array later on.

But using scriptets makes the code messy. A cleaner solution would be to do the intialization in some class, set it in the request scope and access it using EL.
 
Rune Thandy
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. I'll try this.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!