• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confusion in <jsp:useBean>

 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

this will set the value of property "name" as person1 if the attribute person is not available.
but what can we do to set the value of the property dog which is an object not string.??? { as we are giving a value in quotes here}

class Dog:


class Person:

please help!!! i have tried alot but everytime i got an Exception

avi sinha
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The error message tells you there's a problem in index.jsp.
Check the line indicated in the error message, or post the code here.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Christophe Verré wrote:The error message tells you there's a problem in index.jsp.
Check the line indicated in the error message, or post the code here.

i know what the problem is ? i was trying to assign a variable to the value parameter in the <jsp:setProperty>.
i just want to know that, is there any method by which we can set the property dog here using <jsp:setProperty> inside <jsp:useBean>
or setting value like this is valid for only string type properties.

avi sinha
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got the answer. we can write "<% ... %>" must be inside quotes
thanks

avi sinha
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Avi. Here 'value' attribute not only used for strings. We can also use jsp expressions, EL.
 
avi sinha
Ranch Hand
Posts: 453
Google Web Toolkit Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks chinmaya
i was rying without quotes.. that was the problem.
anyway thanks

avi sinha
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic