Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

<jsp:useBean> with type attribute

 
geet rahane
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..
If in the exam there is question like

Q.Which of the following are correct syntax for the use Bean tag?

a)
<jsp:useBean type=classtype class="com.mydomain.CName" />

b)
<jsp:useBean id="mb" type="classtype" class="com.mydomain.CName" />

c)
<jsp:useBean id="mb" class="com.mydomain.CName" />

d)
<jsp:useBean id="mb" type=classtype />


then in this case in option (d) type attribute is used without class...
it is correct if bean is alresdy exist...
but
if it is not given that whether that bean already exist or not then in such case option d is right or wrong???
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please quote your sources.
 
Andriy Pererva
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Geet,
This question is pretty straightforward and asks you only about the syntax, disregarding any runtime conditions "behind the scene" of this code.
So in this case the answer 'd' should be acceptable as well.
 
rachna jain
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well book says if type is mensioned without class bean MUST ALREADY EXIST

if no information is given regarding bean then are we supposed to assume that it exist.

I am not sure about this.
 
Andriy Pererva
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, if the book asks us directly about syntax and nothing else, we should consider this question in terms of:
1) page translation - will it cause any translation error?
2) translated code compilation - will the compilation succed?
In the question below these answers are completely obvious ...
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic