• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EPractice Lab review quiz 3: JSP/Servlet for displaying PNG file

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

You wish to display performance graph as PNG images in a Java EE application
Select the Java EE component suitable for the above scenario :
a. JSP
b. servlet
Given answer : b


I think JSP is more suitable. We can use <jsp:include page="abc.png"> or <@include file ="abc.png"/>
 
Paul Clapham
Sheriff
Posts: 21588
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The question talks about "PNG images" but your question is about "PNG files". If you already had a performance graph in a PNG file in your application, then I'd agree with your answer. But it seems to me that in many (most? all?) cases a performance graph is going to be dynamically generated, and in that case a servlet would be the more suitable tool to display it, no?
 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Paul. Thanks.
By the way, just for everyone's information, <jsp:include page="abc.png"/> won't work. It throws an IllegalStateException.
<jsp:include> works for JSP/html.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic