• 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

jsp:useBean

 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying out the foo.Person example in HFSJ. I get the following error...
org.apache.jasper.JasperException: /result1.jsp(4,0) The value for the useBean class attribute foo.Person is invalid.

Person class is present in web-inf\classes\foo
in my servlet in have
request.setAttribute("Person","<an object of foo.Person class>");

in my jsp I have
<jsp:useBean id="Person" class="foo.Person" scope="request"/>

What am I doing wrong? Why am i getting this error message?

It works fine when I use scripting, but with useBean tag I face the above error.

 
Ramya Iyer
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resolved it. The bean class should have a no arg constructor when jsp:useBean is along with the class attribute
 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A java bean should always have a zer0-arg constructor.
 
Good night. Drive safely. Here's a tiny ad for the road:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic