File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jsp:useBean

 
Nikhil Jain
Ranch Hand
Posts: 389
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Harish Yerneni
Ranch Hand
Posts: 94
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic