提交 | 用户 | 时间
|
e57a89
|
1 |
package com.jcdm.common.xss; |
懒 |
2 |
|
|
3 |
import javax.validation.Constraint; |
|
4 |
import javax.validation.Payload; |
|
5 |
import java.lang.annotation.ElementType; |
|
6 |
import java.lang.annotation.Retention; |
|
7 |
import java.lang.annotation.RetentionPolicy; |
|
8 |
import java.lang.annotation.Target; |
|
9 |
|
|
10 |
/** |
|
11 |
* 自定义xss校验注解 |
|
12 |
* |
|
13 |
* @author jc |
|
14 |
*/ |
|
15 |
@Retention(RetentionPolicy.RUNTIME) |
|
16 |
@Target(value = { ElementType.METHOD, ElementType.FIELD, ElementType.CONSTRUCTOR, ElementType.PARAMETER }) |
|
17 |
@Constraint(validatedBy = { XssValidator.class }) |
|
18 |
public @interface Xss |
|
19 |
{ |
|
20 |
String message() |
|
21 |
|
|
22 |
default "不允许任何脚本运行"; |
|
23 |
|
|
24 |
Class<?>[] groups() default {}; |
|
25 |
|
|
26 |
Class<? extends Payload>[] payload() default {}; |
|
27 |
} |