Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Vector with bean:write tag

 
vikramjit sihint
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I have a class file with a Vector having 3 values.something like....
Vector v=new Vector();
v.add(1,"one")
v.add(2,"two")
v.add(3,"three")
this vector is called in the Formbean

public Vector getEthcontroller()
{
return v;
}
I the jsp page I am calling it as

<bean:write name="netfrm" property="ethcontroller"/>

My problem is I have to extract vlaues for the vector one by one and plcae it to some specific location on the jsp page.

How will I do it.
 
prabhat kumar
Ranch Hand
Posts: 114
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use collection instead of Vector.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34837
369
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vikramjit,
Why are you storing those values in the Vector rather than as 3 separate fields?

While I agree that it is better to use Collection (since it is an interface), I don't see how it would help with this question.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic