This week's book giveaway is in the Java in General forum.
We're giving away four copies of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 and have ishori Sharan & Adam L Davis on-line!
See this thread for details.
Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Need help in useBean tag

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
Guys

I have just started reading HFSJ book
I came across many questions but this forum is helping a lot
I started with JSP
and now on <jsp:useBean>
As per HJSF book
<jsp:useBean> can also create bean!
it 1st searches for existing thing but if it doesn't find one it creates one
does it mean if you write <jsp:useBean > tag in your jsp
and without actually writing class for bean..container will create class which is specified in class attribute of tag...
I didn't get it???

can any one guide?

Thanks
~vaishooD
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vaishoo,

<jsp:useBeanid="obj" class="MyClass" type="MyClass" scope="request"> is just like saying MyClass obj = new MyClass(). So that means your bean class should already exist when you say new on that class. Does this answer your question??
 
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
<jsp:useBean> is used to access the getter setter methods easily in a jsp file.

we have to write a java class for getter setter method, and called it using the tags
<jsp:useBean....>
<jsp:getproperty...>
<jsp:setproperty...>


Dont confuse it with taglib.
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"vaishooD", we don't have many rules around here, but our JavaRanch Naming Policy is one of them. Please review the policy and update your display name accordingly. ("D vaishoo" would be a valid display name according to the policy.)
 
vaishoo Dhembre
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"vaishoo D", your display name is close but still does not follow the naming policy. Please update it accordingly.
 
Marc Peabody
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"vaishoo DD", the policy states that you may use initials for your first name but not for your last name. That is the part of the policy your display name is violating.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic