• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
  • Piet Souris
  • Frits Walraven
  • Carey Brown

EPractice Lab mock exam 5 question 38

Ranch Foreman
Posts: 1922
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

38. You are developing a Java EE application that requires a page to display dynamic chart. Which Java EE component is most suited for the above requirement?
a. Java servlet
b. JSP
c. EJB
d. DAO
Given answer : A
Although servlets and JSP pages can be used interchangeably, each has its own strengths.
Servlets are best suited for service-oriented applications (web service endpoints are implemented as servlets) and the control functions of a presentation-oriented application, such as dispatching requests and handling non-textual data.
- servlets are most effectively used for implementing logic and generating binary content.
-use servlets to implement services.
- servlets are usually not visual components, except for some that generate binary content.
- instead , think of a servlet as an information service provided by an application
- a servlet can perform whatever service it provides- templating , security, personalization, application control- and then select a presentation component (often a JSP page) to which it forwards the request for display.
- use servlets as controllers
-user servlets to generate binary content
-avoid writing servlets that print mostly static text.

JSP pages are more appropriate for generating text-based markup such as HTML, scalable vector graphics, wireless markup language and xml.

I think b is a possible choice because we can use <jsp:include page="dyamicPage.jsp"/> to include dynamic content in a page.
Posts: 3648
Mac OS X Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think the question is asking not just the "display" but the stuff before it: generating the data for the dynamic chart.

If JSP was the correct answer, people may think the JSP will have Java code in it which is indeed not best practice.
Posts: 322
Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's tough. As soon as I read "requires a page to display", I thought presentation layer and that JSP was the right answer, too.

I've not done this exam, but for those who have, is the exam as ambiguous as some of the questions Himai has been posting from this mock exam?
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic