O'Reilly logo

Head First Servlets and JSP, 2nd Edition by Bert Bates, Bryan Basham, Kathy Sierra

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using <scripting-invalid>

image with no caption
image with no caption

It’s simple—you can make it invalid for a JSP to have scripting elements (scriptlets, Java expressions, or declarations) by putting a <scripting-invalid> tag in the DD:

image with no caption

Watch out—you might have seen other books or articles show a page directive that disables scripting. In a draft version of the 2.0 spec, there was a page directive attribute:

<%@ page isScriptingEnabled=”false” %>

Note

This does not work! The isScriptingEnabled attribute is no longer in the JSP spec!

but it was removed from the final spec!!

The only way to invalidate scripting now is through the <scripting-invalid> DD tag.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required