| Author |
jsp:useBean
|
Nikhil Jain
Ranch Hand
Joined: May 15, 2005
Posts: 383
|
|
Hello Ranchers, In HFS, Chapter Scriptless JSP's, what happens if we declare a type but not a class <jsp useBean id = "person" type="foo.person" scope = "page"/> ? The books says that, if the type is used without class, the bean must already exists?. What does this mean? Does this mean, there would be a statement something like request.setattribute("person", p) in the servlet; so if the setAttribute statement does not exists, will the useBean property create one? I am getting confused?
|
SCJP 1.4, SCWCD 1.4, SCBCD 1.5
|
 |
Harish Yerneni
Ranch Hand
Joined: Sep 15, 2004
Posts: 94
|
|
yes. It will generally create one but not in this case because it doesnt know which instance it should create of foo.Person p = new (of what)? foo.Person (type) foo.Employee(class) in usebean tag. Hope it helps!
|
SCJP 1.4 | SCWCD 1.4 | SCJD (WIP)
|
 |
Marc Peabody
pie sneak
Sheriff
Joined: Feb 05, 2003
Posts: 4726
|
|
"Rajesh", we don't have many rules around here but our naming policy is one of them. Not complying with the policy will lead to your account becoming locked. This warning hopefully will prevent that from happening, but some action is required on your part. Please review the policy here and you can change your Publicly Displayed Name here.
|
A good workman is known by his tools.
|
 |
 |
|
|
subject: jsp:useBean
|
|
|