This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin for Android App Development and have Peter Sommerhoff on-line!
See this thread for details.
Win a copy of Kotlin for Android App Development this week in the Kotlin 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
  • Liutauras Vilda
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

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

 
Ranch Hand
Posts: 463
Eclipse IDE Java Tomcat Server
  • 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
Java Oracle
  • 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 Java Tomcat Server
  • 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 Java VI Editor
  • 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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!