javax.servlet.jsp.jstl.tlv

Class ScriptFreeTLV


public class ScriptFreeTLV
extends TagLibraryValidator

A TagLibraryValidator for enforcing restrictions against the use of JSP scripting elements.

This TLV supports four initialization parameters, for controlling which of the four types of scripting elements are allowed or prohibited:

The default value for all for initialization parameters is false, indicating all forms of scripting elements are to be prohibited.

Authors:
Mark A. Kolb
Shawn Bayern (minor changes)

Constructor Summary

ScriptFreeTLV()
Constructs a new validator instance.

Method Summary

void
setInitParameters(Map initParms)
Sets the values of the initialization parameters, as supplied in the TLD.
ValidationMessage[]
validate(String prefix, String uri, PageData page)
Validates a single JSP page.

Constructor Details

ScriptFreeTLV

public ScriptFreeTLV()
Constructs a new validator instance. Initializes the parser factory to create non-validating, namespace-aware SAX parsers.

Method Details

setInitParameters

public void setInitParameters(Map initParms)
Sets the values of the initialization parameters, as supplied in the TLD.

Parameters:
initParms - a mapping from the names of the initialization parameters to their values, as specified in the TLD.


validate

public ValidationMessage[] validate(String prefix,
                                    String uri,
                                    PageData page)
Validates a single JSP page.

Parameters:
prefix - the namespace prefix specified by the page for the custom tag library being validated.
uri - the URI specified by the page for the TLD of the custom tag library being validated.
page - a wrapper around the XML representation of the page being validated.

Returns:
null, if the page is valid; otherwise, a ValidationMessage[] containing one or more messages indicating why the page is not valid.


Copyright 2003 Sun Microsystems, Inc. All Rights Reserved.