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

 
Manpreet S Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<html>
<body>
--------- INSERT CODE HERE -----------
<jsp:forward page="/usebean2.jsp" />
</body>
</html>

and the following code for usebean2.jsp:

<html>
<body>

<h1>JSP Page 2</h1>
Media/DVD : ${sessionScope.media.format} <br>
</body>
</html>

You want usebean1.jsp to create and put a DVD bean in the session and expose the scripting variable 'media', which will be used by usebean2.jsp. Which of the following declarations can be inserted in usebean1.jsp to achieve this?

1 <jsp:useBean id="media" type="com.enthuware.jwebplus.Media" class="com.enthuware.jwebplus.DVD" scope="session" />

2<jsp:useBean id="media" type="com.enthuware.jwebplus.Media" scope="session" />

3 <jsp:useBean id="media" class="com.enthuware.jwebplus.DVD" scope="session" />


What is the correct answer of this question
 
mimi chatterjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think the right answer is (c)..because the info about Media class is not provided.
 
Manpreet S Singh
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
text was:

Answer is 1 and 3 can you please tell y 2 is not the answer
 
mimi chatterjee
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
for (2)..if you use type without class the bean have to be exist....means you are using a bean that has already created.but in this text this is not happening.
 
Joy Mukherjee
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Answer is 1 and 3 type can only be used if the bean exist in the scope.

Thanks and Regards
Joy
 
Jan Sterk
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Joy Mukherjee:
Answer is 1 and 3 type can only be used if the bean exist in the scope.

Thanks and Regards
Joy


That's right, but you mean ".. type without class ..".
 
Joy Mukherjee
Ranch Hand
Posts: 62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep thats correct in the context of the question there is only type no class

Thanks and Regards
Joy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic