aspose file tools*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes (ANOTHER) Question from Head First Servlets and JSP's Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "(ANOTHER) Question from Head First Servlets and JSP Watch "(ANOTHER) Question from Head First Servlets and JSP New topic
Author

(ANOTHER) Question from Head First Servlets and JSP's

Eurig Jones
Ranch Hand

Joined: Feb 05, 2008
Posts: 57
Which statements about disabling scripting are true? (Choose all that 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 programmatically by using the isScriptingEnabled page directive attribute
D. You can disable scripting via the DD by using the <scripting-invalid> element.


Answer from the book: D

My question is why isn't B also part of the answer? The DD is application level and you can ONLY disable scripting through the DD. (isScriptingEnabled page attribute is deprecated)

Am I wrong here?
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

It says:

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

It's not true because you may do it via DD (declarative configuration) or via directive on the JSP page which for me is the mentioned "application level".

Regards,
Krzysztof


SCJP 5.0, SCWCD 5.0, SCBCD 5.0, SCEA/OCMJEA 5.0
Eurig Jones
Ranch Hand

Joined: Feb 05, 2008
Posts: 57
but you can't do it via a page directive anymore. isScriptingEnabled page attribute has been removed.

What is your definition of application level? What I have as "application level" in my head is a low level such as the "application scope" or where you define your dtd before you deploy.
[ August 31, 2008: Message edited by: Eurig Jones ]
Krzysztof Koziol
Ranch Hand

Joined: Nov 19, 2006
Posts: 133

Sorry, I was thinking about EL which may be enabled by page directive with a isELIgnored param.
The scripting can be disabled only via DD using <scripting-invalid>. Don't know how to disable/enable it in the *.jsp code

Regards,
Krzysztof
siyabonga khanyile
Greenhorn

Joined: Aug 22, 2008
Posts: 12
Yah you can only disable scripting on DD but it doesnt have to be application level cos you use <url-pattern> to select the sections where you it to be disabled.
Eurig Jones
Ranch Hand

Joined: Feb 05, 2008
Posts: 57
But what IS the definition of "Application Level" here exactly?

Is configuring the DD not considered configuring something at the application level?
[ September 06, 2008: Message edited by: Eurig Jones ]
Eurig Jones
Ranch Hand

Joined: Feb 05, 2008
Posts: 57
Anyone have any feedback on this?

Thanks in advance,
Eurig
Raghavendra Harapanahalli
Greenhorn

Joined: Mar 20, 2008
Posts: 15
Please check the following web.xml fragment

<jsp-config>
<jsp-property-group>
<url-pattern>*.do</url-pattern>
<scipting-invalid>true</scripting-invalid>
<el-ignored>false</el-ignored>
<jsp-property-group>
<taglib>
<taglib-uri>helloWorld</taglib-uri>
<taglib-location>/WEB-INF/hello.tld</taglib-location>
</taglib>
<jsp-config>


always scripting invalid is specifies for a url-pattern which hence can be to anything from a single JSP to the Entire Web Application.Hence,i feel B cannot be right..


SCJP 94%<br />SCWCD 94%
Eurig Jones
Ranch Hand

Joined: Feb 05, 2008
Posts: 57
Ahh yes! Thanks Raghavendra.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: (ANOTHER) Question from Head First Servlets and JSP's
 
Similar Threads
Disabling Scripting
HFSJ First Edition - Being a JSP - Mock Exam Question 13
HFSJ question: disable scripting?
Question 13 from ch7 Using JSP chapter
HFSJ Mock exam 7 Q13 page 338