This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

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
internet detective
Marshal

Joined: May 26, 2003
Posts: 30136
    
150

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
 
Similar Threads
The method setValue(String, Object) in the type TagSupport is not applicable for the arguments (Obje
using logic:iterate tag to access ActionForm elements
The method setValue(String, Object) in the type TagSupport is not applicable for the arguments (Obje
use a object in the form
Can you have a String type method return two String values, or do I need to use String array?