Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

HFSJ First Edition - Being a JSP - Mock Exam Question 13

 
Ranch Hand
Posts: 463
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear All,

Q: Which statements about disabling scripting elements are true? (Choose all the apply.)

A. You can't disable scripting via the DD.
B. You can only disable scripting at the application level.
C. You can disable scripting programatically by using the isScriptingEnabled page directive attribute.
D. You can disable scripting via the DD by using the <scripting-invalid> element.

I answered BD. But the correct answer as per the book is only D.

I don't understand why answer B is not correct . Giving <scripting-invalid> in the DD disables scripting
for all the JSP's matching a particular URL pattern which is for the whole application. So we can only disable
scripting at the application level and NOT at individual JSP level.

Please correct me if I am wrong.
 
Ranch Hand
Posts: 437
Oracle Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sai.

B. You can only disable scripting at the application level.



What you have explained above is true for application level. We can also disable scripting for individual jsp through DD. Here the question has mentioned the word 'only', I think this caused option B not correct.
 
Sai Surya
Ranch Hand
Posts: 463
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Chinmaya Chowdary wrote: We can also disable scripting for individual jsp through DD.



Thanks for reply Chinmaya and it makes sense now, however how do we disable scripting for individual JSP through DD? Do we give the exact URL of the JSP in the <url-pattern>?
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Do we give the exact URL of the JSP in the <url-pattern>?



Yes , BTW there is no such thing as "isScriptingEnabled" , its was just in draft which dint make it to the final release.
 
I wish to win the lottery. I wish for a lovely piece of pie. And I wish for a tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic