Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error using c:set for javaBean property

 
Phil Kurian
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I'm having a bit of trouble using the jstl c:set command for setting properties on javaBeans.

The jsp I've written is as below. The bean I'm using has a single property called "name" and it's a String. The relevant public getters and setters have been written





Unfortunately I get the following error in Tomcat

org.apache.jasper.JasperException: Invalid property in <set>: "name"

As far as I can tell the JSP can access the bean, as I am able to use the jsp:setProperty and jsp:getProperty methods successfully.

Could anyone give me some direction on what I'm doing wrong?

thanks
[ July 10, 2006: Message edited by: Phil Kurian ]
 
Narendra Dhande
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

The target object must evaluate to Object of type bean.

Try this

<c:set value="PK676" target="${phil}" property="name" />

Thanks
 
Phil Kurian
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Narendra,

It worked perfectly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic