I was just coding a Stripes action bean, starting with an annotated method.
By mistake i wrote:
@After(stages = LifecycleStage.ActionBeanResolution) {
// code here
}
The compiler is OK
So it seems we can put annotations on static and nonstatic init blocks
@After(stages = LifecycleStage.ActionBeanResolution)
{
// code here
}
@After(stages = LifecycleStage.ActionBeanResolution)
static {
// code here
}
Do you have any usecase idea of such a strange thing?
抱歉,这是我的问题,它无法编译
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.