@Documented @Constraint(validatedBy={}) @Target(value={METHOD,FIELD,ANNOTATION_TYPE,CONSTRUCTOR,PARAMETER,TYPE_USE}) @Retention(value=RUNTIME) @Repeatable(value=SafeHtml.List.class) public @interface SafeHtml
Note that this constraint assumes you want to validate input which represents a body fragment of an HTML document. If
you instead want to validate input which represents a complete HTML document, add the html
, head
and
body
tags to the used whitelist as required.
Modifier and Type | Optional Element and Description |
---|---|
String[] |
additionalTags |
SafeHtml.Tag[] |
additionalTagsWithAttributes |
String |
baseURI |
Class<?>[] |
groups |
String |
message |
Class<? extends Payload>[] |
payload |
SafeHtml.WhiteListType |
whitelistType |
public abstract String message
public abstract Class<?>[] groups
public abstract SafeHtml.WhiteListType whitelistType
public abstract String[] additionalTags
whitelistType()
.public abstract SafeHtml.Tag[] additionalTagsWithAttributes
public abstract String baseURI
Copyright © 2019 JBoss by Red Hat. All rights reserved.