Package io.goobi.viewer.faces.validators
Class HtmlScriptValidator
java.lang.Object
io.goobi.viewer.faces.validators.HtmlScriptValidator
- All Implemented Interfaces:
jakarta.faces.validator.Validator<String>,EventListener
public class HtmlScriptValidator
extends Object
implements jakarta.faces.validator.Validator<String>
Validates that any input text has no "script" tags
- Author:
- Florian Alpers
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvalidate(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String input) Throws aValidatorExceptionwith message keyvalidate_error_scriptTagifvalidate(String)returns falsebooleanReturns false if the input string is not blank and does not contain the string<script(disregarding case)
-
Constructor Details
-
HtmlScriptValidator
public HtmlScriptValidator()
-
-
Method Details
-
validate
public void validate(jakarta.faces.context.FacesContext context, jakarta.faces.component.UIComponent component, String input) throws jakarta.faces.validator.ValidatorException Throws aValidatorExceptionwith message keyvalidate_error_scriptTagifvalidate(String)returns false- Specified by:
validatein interfacejakarta.faces.validator.Validator<String>- Throws:
jakarta.faces.validator.ValidatorException
-
validate
Returns false if the input string is not blank and does not contain the string<script(disregarding case)- Parameters:
input- aStringobject.- Returns:
- a boolean.
-