• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP:: How to set a list of values using setProperty?

 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai All!
Here is my problem. I have JSP page that is tied to a Javabean in which one of properties are Array of Strings.
Now my problem is regarding how to set values in JSP page using setProperty tag? Is it possiblw witout using Scriptlets?
Rgds
Manohar
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13061
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To put values from a bean into the page you need <jsp:getProperty tag. Since getProperty uses only the name of the property, I don't see how you could address individual elements of the array without doing some extra programming as scriptlets or custom tags.
Bill

------------------
author of:
 
Manohar Karamballi
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hai!
Thanks for ur reply. Can u explain what are custom tags in JSP with an example?
TIA
Rgds
Manohar
 
Sunetra Saha
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Custom tags are tags just like<jsp: SetProperty> but are tags whose implementation is written by yourself. There are lots of tutorials available for writing custom tags - even on the sun site itself.
Try this http://java.sun.com/j2ee/tutorial/doc/JSPTags2.html>
or this http://developer.java.sun.com/developer/Books/cservletsjsp/chapter14.pdf
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic