• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Error using c:set for javaBean property

 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
Ranch Hand
Posts: 951
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Narendra,

It worked perfectly.
 
Did you just should on me? You should read this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic