• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

query regarding jsp:setProperty

 
sandeep yel
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

Consider a java bean named "Person" having two properties "name" and "dog".
The value type for "name" property is String and the value type for "dog" property is Dog class.

To set the dog property of "person" in request scope can I use something like this.

<jsp:useBean id="person" class="foo.Person" scope="request">
<jsp:setProperty id="person" property="dog" value="<%= new Dog() %>" />
</jsp:useBean>

Or only allowed option for value in <jsp:setProperty> is String and primitive.
 
Kathiresan Chinna
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The value can be a String or an expression.

See the syntax reference here http://java.sun.com/products/jsp/tags/11/syntaxref11.fm13.html

Kathir
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic