• 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

Doubts/errata in HFSJ final mock exam?

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following doubts about the HFSJ final mock exam:

Question 12: In this question, the tld specifies body-content as empty, but the tag handler class extends TagSupport, and in its doStartTag, it returns SKIP_BODY or EVAL_BODY_INCLUDE based on an if condition. My doubt is that even if it compiles fine, shouldn't it throw translation error, as we cannot return EVAL_BODY_INCLUDE if the body-content is defined as empty?

Question 22: This question asks which JSP code would you use to include static content in a JSP; this marks jsp:include standard action as a correct answer, but gives RequestDispatcher.include() as wrong answer. My doubt is that if jsp:include is correct, why is RequestDispatcher.include() wrong?

Question 40: This question says that the following statement is true: "The web container calls the servlet's destroy() method when the servlet is destroyed or unloaded." My doubt is that destroy() method is called BEFORE the servlet is destroyed, not when (just after)

Question 63: In this question, it says that line 4 (jsp:setProperty) will not generate an error... but my doubt is that before jsp:setProperty, we are not having any jsp:useBean declaration... so shouldn't it generate an error???
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you give the questions also .. then it would be easy for any of them .. to answer you..

Regards
Madhav
 
Ranch Hand
Posts: 119
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question 12 It should give runtime error when you try running the jsp page but oh they have not even mentioned that as an option.

Question 22 : It is weird since RequestDispatcher option also seems to be true but what i can make out max from it is it should be inside the scriptlet to make it a valid option (i know this seems stupid but thats the max i can think on it)

Question 40 : destroy() method is called just before the servlet is destroyed .your are right on it i guess.

Question 63 : you are again right on it ...i tried it it gave error.

Hope i cleared things up.
Regards
Rishi Chopra
 
Harshit Patel
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot Rishi (I was too lazy to type the questions )

But I agree with you on the RequestDispatcher question (no. 22), because that code is servlet, not JSP (it is not inside a scriptlet)

But the rest of the questions (or rather, the answers given) are still confusing for me...
 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks to all,

Just encountered number 63, got me a bit angry.
Relief that I was right in my understanding that first a bean has to be instantiated before any value can be set.
(or setProperty in the body of useBean...)

Thanks ALL!

Greetz
Bert
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic