| Author |
best way to access the vector in jsp
|
Gina Ferrara
Greenhorn
Joined: Jul 02, 2003
Posts: 6
|
|
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
internet detective
Marshal
Joined: May 26, 2003
Posts: 26192
|
|
|
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.
|
[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56192
|
|
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.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
 |
|
|
subject: best way to access the vector in jsp
|
|
|