• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

best way to access the vector in jsp

 
Gina Ferrara
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I like to know the best way to access a already populated vector in jsp.
I have servlet that talks to the backend beans and populate a vector



now in the jsp I have the following code

So is this a best practice to access the object I have placed into the vector?
Is there a better way to do this?

Gena
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34973
378
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. You can use JSTL/EL. JSTL has a c:forEach tag for looping through a vector. EL lets you ${xmlObject.name} output properties of the loop element.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65217
95
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to make sure that there is no ambiguity, Jeanne's "yes" answer was to the question:
Is there a better way to do this?


Java code in scriptlets is an extremely poor practice that it almost 10 years out-of-date.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic