mirror of
https://codeup.aliyun.com/67c68d4e484ca2f0a13ac3c1/ydc/jsowell-charger-web.git
synced 2026-04-21 11:35:12 +08:00
27 lines
696 B
Java
27 lines
696 B
Java
package com.jsowell.common.xss;
|
|
|
|
import javax.validation.Constraint;
|
|
import javax.validation.Payload;
|
|
import java.lang.annotation.ElementType;
|
|
import java.lang.annotation.Retention;
|
|
import java.lang.annotation.RetentionPolicy;
|
|
import java.lang.annotation.Target;
|
|
|
|
/**
|
|
* 自定义xss校验注解
|
|
*
|
|
* @author jsowell
|
|
*/
|
|
@Retention(RetentionPolicy.RUNTIME)
|
|
@Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER })
|
|
@Constraint(validatedBy = { XssValidator.class })
|
|
public @interface Xss{
|
|
String message()
|
|
|
|
default "不允许任何脚本运行";
|
|
|
|
Class<?>[] groups() default {};
|
|
|
|
Class<? extends Payload>[] payload() default {};
|
|
}
|