The JSP expression language provides succinct and easy-to-read access to scoped variables (Java objects stored in the standard locations). This capability eliminates much of the need for the explicit Java scripting elements described in Chapter 11. In fact, some developers prefer to use a no-classic-scripting-elements approach throughout their entire projects. You can use the scripting-invalid subelement of jsp-property- group to enforce this restriction. For example, the following web.xml file indicates that use of classic scripting elements in any JSP page will result in an error. <?xml version="1.0" encoding="ISO-8859-1"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation= "http://java.sun.com/xml/ns/j2ee web-app_2_4.xsd" version="2.4"> <jsp-property-group> <url-pattern>*.jsp</url-pattern> <scripting-invalid>true</scripting-invalid> </jsp-property-group> </web-app> |