• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need help in useBean tag

 
vaishoo Dhembre
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • 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
 
Joe Harry
Ranch Hand
Posts: 10128
3
Eclipse IDE Mac PPC Ubuntu
  • Mark post as helpful
  • send pies
  • 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??
 
NDP Prasad
Ranch Hand
Posts: 177
  • Mark post as helpful
  • send pies
  • 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.
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thanks a lot
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • 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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic