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

Mock exam question about Java EE components

 
Marcus Denker
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have answered the following mock exam question incorrectly the mock exam evaluation says:

You are designing a Java EE application presentation tier component that need to generate XML documents and unstructured text document
Select the best Java EE component for the above scenario:
...Java Servlet, JSP or JSF

I selected "JSF" - but they say the correct answer was "JSP"!

Do you agree?

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I wouldn't use JSP or JSF for generating XML, but I can understand why they chose JSP. They are trying to show that JSF is good for form fields and such that have meaning.
 
Tom Jos
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think JSP is the correct answer as the question specifically mentioned presentation layer.
 
Mike Degteariov
Ranch Hand
Posts: 145
8
Java Mac MySQL Database Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My take is Servlet.

I can not imagine how one could use JSP for generating XML, without resorting to scriptlets or custom tags.
Using scriptlets is straight up bad practice, and using custom tags introduces unnecessary complexity,
since in addition to writing custom tag you'll have to create a descriptor and register it in web.xml

On the other hand, servlet can produce any output, be it XML or any other binary or text output you need.
 
Sergio Figueras
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My take is servlet too. I can't see JSP for generating XML.

Man, my advice is: take care with free mock tests, because they brought me a lot of problems in my old SCJP exam. I've made more than 400 questions and most of them was incorrect. If you can, the best is to pay for Whizlabs or EPractize.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic