• Post Reply Bookmark Topic Watch Topic
  • New Topic

Multiple Values in JSP  RSS feed

 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

How to give the multiple values for one variable in JSP??

Ex: If i have a variable called "Name" then i need to enter 100 names with one single variable called "Name". How to iterate this in JSP??

Please Help
Thanks.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
An array or List is the customary way to model multiple values.

Iteration in a JSP is accomplish with the JSTL <c:forEach> tag.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66207
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. scoped variable names should follow normal Java naming conventions, so starting a variable name with a capital letter, as in "Name", is not appropriate.
 
Chandana Garlapati
Ranch Hand
Posts: 97
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear Bibeault

Could you give some example how to use JSTL <c:foreach> tag.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!