File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes best way to access the vector in jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "best way to access the vector in jsp" Watch "best way to access the vector in jsp" New topic
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
    
  66

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
    
  13

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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: best way to access the vector in jsp
 
Similar Threads
How do i collect XML object on a JSP page
Query related to com.bea.xml.XmlObject
AXIS2 - set conditions - XmlValueDisconnectedException
Loading xml in Javascript fails
Loading xml in JavaScript Fails