File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes Vector using logic:iterate in struts framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Vector using logic:iterate in struts framework" Watch "Vector using logic:iterate in struts framework" New topic
Author

Vector using logic:iterate in struts framework

Janak Rana
Greenhorn

Joined: Oct 14, 2010
Posts: 7
hello all,

I have pojo class. I am just adding pojo object in the Vector.
i have to access through logic:iterate tag in jsp ..how this possible ?
userinfo.java
=========


UserList.java
=======



how do i get all 3 object in jsp logic:iterate tag?

thankx in advance..
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

Janak,
Welcome to CodeRanch! I added code tags to make this display better.

Yes, you can use logic:iterate to loop through the 3 elements. You use the type attribute to say the type of class in the list is userinfo. Then you can use bean:write's property attribute to output the right field.


[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
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30894
    
158

And a note on Java conventions. It is convention to use camelcase for class names so userinfo would be UserInfo. Similarly, it is convention for fields to be lowercase so Users would be user. Following these conventions will make it easier for others to understand your code and is a good habit to get into.
Janak Rana
Greenhorn

Joined: Oct 14, 2010
Posts: 7
Thankx Jeanne Boyarsky ...
just i have change my code in previous post and look into the code and give me reply.
Thank you.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Vector using logic:iterate in struts framework