• 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

bean use

 
Ranch Hand
Posts: 318
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How does the JSP engine instantiate the bean ?
Is it mandatory to have no args constructor ?
what exactly is scope ?
 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
The Javabean API requires a class to have a no args constructor. This is so the system is able to instantiate the bean using the instantiate() method found in the java.beans.Beans package. I assume the jsp engine uses the same method to instantiate the bean though I'm not positive.
But Yes, it is mandatory to have no args constructor
scope, as I understand it, refers to an object which holds attrubutes. Each attribute has a unique identifying name linked to an object. A javabean would be such an attribute. There are 4 kinds of scope, indicating how much access there is to the bean. for example, a bean with page scope is only visible and accessable by the jsp page which contains it. a bean with request scope is visible to the page which contains it as well as any jsp or servlet the page is forwarded to. Session scope indicaties a bean is visible to all jsps and servlets which are part of the same session and application scope means the bean is available to all jsps and servlets in the entire web application...
I think
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic