• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vector using logic:iterate in struts framework

 
Janak Rana
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34863
369
Eclipse IDE Java VI Editor
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thankx Jeanne Boyarsky ...
just i have change my code in previous post and look into the code and give me reply.
Thank you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic