• 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 doubt

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

In a java class XMLAdd I have 3 variables document, outDoc, outDocNode of type org.jdom.Document and one variable of type java.io.File.

In a jsp showall.jsp I declared this class as a java bean using jsp:useBean tag.
But there exists a error at useBean declaration as the work directory showing error.
and in jsp:setProperty i am setting all the properties of the bean.
So is it mandatory that I need to provide setters and getters for all the 4 variables ?

Below are the snippets for the class, jsp.


setters and getters are defined for xmlFile and outDoc only.

showall.jsp:



when I see the work directory the generated servlet code is stopped at the useBean declaration of XMLAdd class.

the generated servlet code :



so is that the error is due to that there are no getters and setters for document and outDocNode variables ?

Thanks,

[ February 26, 2007: Message edited by: vijay kumarg ]
[ February 26, 2007: Message edited by: vijay kumarg ]
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, useBean follows the JavaBean conventions and looks for setter methods in order to populate your bean's fields.
 
The City calls upon her steadfast protectors. Now for a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic