Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which answer right?

 
halena chen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A JSP page needs to instantiate a JavaBean to be used by only that page Which two jsp:useBean attributes must be used to access this attribute in the JSP page?(Choose two)
A.id
B.type
C.name
D.class
E.scope
F.create
 
Srinivasan thoyyeti
Ranch Hand
Posts: 558
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

As bean needs instantiation,

we have to create it. so we need class for that. and id for creating the reference.

<jsp:useBean id="reference" class="Sample"/>

will genrate code like this:

Sample reference = new Sample();
 
PRavi kumar
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
id
class.

by default the bean scope is page. if your not define any scope the bean will create with page scope

<jsp:useBean id="user" calss = "com.abc.testclass" />
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please tell us what you think of it first, or what your doubt is.
 
halena chen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My answer is id and class too, thanks guys!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic