This week's book giveaway is in the Other Languages forum.
We're giving away four copies of Functional Reactive Programming and have Stephen Blackheath and Anthony Jones on-line!
See this thread for details.
Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Question 13 from ch7 Using JSP chapter

 
Veena Pointi
Ranch Hand
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2451
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 442
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 2451
96
Android Chrome Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
    Posts: 442
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Hello Frits,

    Now this makes sense . Thank you once again.

    Veena
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic