aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Question 13 from ch7 Using JSP chapter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Question 13 from ch7 Using JSP chapter" Watch "Question 13 from ch7 Using JSP chapter" New topic
Author

Question 13 from ch7 Using JSP chapter

Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
Hello,

In HFSJ cha 7, Question 13 is as follows.

13. Which statements about disabling scripting elements are true
A.You can't disable scripting via the DD
B.You can only disable scripting at the application level.
C.Yo can disable scripting programmatically by using the isScriptingEnabled page directive attribute.
D.You can disable scripting via the DD by using the <scripting-invalid> element.

Ans is D

My doubt is isn't B also right answer? We can only disable scripting at application level,not page level,right?

Thanks,
Veena


SCJP1.4
"Continuous effort - not strength or intelligence - is the key to unlocking our potential."
*Winston Churchill
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1529
    
  22

My doubt is isn't B also right answer? We can only disable scripting at application level,not page level,right?

How would you be able to do that? Where would you do that in your code?

Regards,
Frits
Veena Pointi
Ranch Hand

Joined: Jun 20, 2002
Posts: 442
In the DD using scipting-invalid .When we set this,
scripting is disabled for jsps in all aplications.
So i thought ans B is correct.
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1529
    
  22

In the DD using scipting-invalid .When we set this,
scripting is disabled for jsps in all aplications.

Ok, that is what you meant.

Yes that is true if you have the following lines:

But you can set the URL-pattern as you like, so let's say you have a small jsp (called scripting.jsp) like this:

and you will put it into two different directories:
  • (WebAppRoot)/jsp/scripting.jsp
  • (WebAppRoot)/scriptingjsp/scripting.jsp

  • and if you now have the following lines in your web.xml:
    you will be able to see the scripting.jsp in the jsp directory but you won't be able to see it in the scriptingjsp directory.

    With the url-pattern you can disable scripting for one jsp, a group of jsp's or all jsp's in your web-application, that is why B is not correct

    Regards,
    Frits
    Veena Pointi
    Ranch Hand

    Joined: Jun 20, 2002
    Posts: 442
    Hello Frits,

    Now this makes sense . Thank you once again.

    Veena
     
    I agree. Here's the link: http://aspose.com/file-tools
     
    subject: Question 13 from ch7 Using JSP chapter
     
    Similar Threads
    (ANOTHER) Question from Head First Servlets and JSP's
    Disabling Scripting
    HFSJ First Edition - Being a JSP - Mock Exam Question 13
    HFSJ question: disable scripting?
    HFSJ Mock exam 7 Q13 page 338