• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

JSP question ? Clarify

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Given a JSP page called mypage.jsp with the following code

<%
request.setAttribute("greeting","good");
%>
<jsp:include page="menu.jsp" />
<p>morning</p>

And an available file called menu.jsp that contains the following code

<%
String greeting = (String) request.getAttribute("greeting");
out.print(greeting);
%>

What will happen when you attempt to compile and run mypage.jsp?
Choose one answer.
a. Compilation error the jsp:include tag takes a paramter of file not page Incorrect
b. compilation and output of good only Incorrect
c. compilation and output of good morning Correct
d. compilation and output of greeting Incorrect
e. compilation and output of greeting morning Incorrect
f. compilation and output of greeting morning Incorrect
Answer is c .
 
Ranch Hand
Posts: 178
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
C is the correct answer. What is your doubt?
 
reply
    Bookmark Topic Watch Topic
  • New Topic