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

<jsp:usebean ... action

 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is from javabeat.net

Please select CORRECT JSP useBean declaration methods
Please select three correct answers
A.<jsp:useBean id="user" beanName="TestUser" type="com.test.model.User" />
B.<jsp:useBean id="user" beanName="TestUser" class="com.test.model.User" />
C. <jsp:useBean beanName="TestUser" class="com.test.model.User" />
D. <jsp:useBean beanName="TestUser" class="com.test.model.User" />
E. <jsp:useBean id="user" type="com.test.model.User" />

Answer ADE

Is option D is correct?even if we write type instead of class, is it right , not to have id attribute?

Thanks,
Geeta
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Geeta. Here option D is wrong. We cannot have, attributes beanName and class inside <jsp:useBean ...> together. We can write it is valid.
 
geeta vemula
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
so id attribute is not mandatory?
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Geeta. I am sorry, attribute 'id' is mandatory.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic