Class HtmlScriptValidator

java.lang.Object
io.goobi.viewer.faces.validators.HtmlScriptValidator
All Implemented Interfaces:
EventListener, javax.faces.validator.Validator<String>

public class HtmlScriptValidator extends Object implements javax.faces.validator.Validator<String>
Validates that any input text has no "script" tags
Author:
Florian Alpers
  • Field Summary

    Fields inherited from interface javax.faces.validator.Validator

    NOT_IN_RANGE_MESSAGE_ID
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns false if the input string is not blank and does not contain the string <script (disregarding case)
    void
    validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String input)
    Throws a ValidatorException with message key validate_error_scriptTag if validate(String) returns false

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HtmlScriptValidator

      public HtmlScriptValidator()
  • Method Details

    • validate

      public void validate(javax.faces.context.FacesContext context, javax.faces.component.UIComponent component, String input) throws javax.faces.validator.ValidatorException
      Throws a ValidatorException with message key validate_error_scriptTag if validate(String) returns false
      Specified by:
      validate in interface javax.faces.validator.Validator<String>
      Throws:
      javax.faces.validator.ValidatorException
    • validate

      public boolean validate(String input)
      Returns false if the input string is not blank and does not contain the string <script (disregarding case)
      Parameters:
      input - a String object.
      Returns:
      a boolean.