This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

jsp usebean  RSS feed

 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can we set multiple values for a single property(user) in the below single setProperty tag

 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean ? What type is this "user" property ?
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:What do you mean ? What type is this "user" property ?


its a String field in Login class. i want to store this user field with multiple values using the setProperty tag.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's a String, it can only have one value. What do you mean by multiple values ? Do you have an example ?
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well in that case make user a bean that holds the necessary values. This way you can use multiple setProperty tags. The way you did it will never work. You cannot have two attributes that have the same name.

Also, how do you suppose the two values get saved into the String ?
 
Jithesh Kumar
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i meant storing multiple values for multiple object of the bean class.is there any tag for creating multiple object and storing multiple value for user attribute
 
Sebastian Janisch
Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jsp:useBean instantiates an instance for you (if it does not already exist). So if you want to use an x amount of beans, create an x amount of instances before using them.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!