import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
/**
* 自定义注解防止表单重复提交
*/
@Inherited
@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
public @interface RepeatSubmit {
}
/**
*在防止重复提交的方法上面添加上面自定的的注解
*/
@RepeatSubmit
public void insertOrder(Order order)
{
System.out.println("防止表单重复提交");
}
11-09
44
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
07-23
443
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)