Stripes是一个视图框架用于利用最新的Java技术来构建Web应用程序.
1.@SessionScope
net.sourceforge.stripes.action.SessionScope
@Target(value={TYPE})
@Retention(value=RUNTIME)
@Documented
Annotation that is used to specify that an ActionBean should be instantiated and stored across requests in the Session scope. By default ActionBeans are instantiated per-request, populated, used and then discarded at the end of the request cycle. Using this
annotation causes an ActionBean to live for multiple request cycles. It will be instantiated and put into session on the first request that references the ActionBean. A reference to the bean will also be placed into RequestScope for each request that references
the bean, thereby allowing the rest of Stripes to treat it like any other ActionBean.
Since session scope ActionBeans are not generally encouraged by the author, very few allowances will be made in Stripes to accommodate session scope beans. This means that additional mechanisms to handle session scope beans do not exist. However, there are
general mechanisms built in to Stripes that will allow you to overcome most if not all issues that arise from Session scoping ActionBeans.
2.@SpringBean
net.sourceforge.stripes.integration.spring.SpringBean
@Target(value={FIELD, METHOD})
@Retention(value=RUNTIME)
@Documented
Annotation used for injecting Spring managed beans into objects within Stripes (usually ActionBeans). The value of the annotation represents the name of the bean in the Spring application context to inject. If the value is omitted then Stripes will attempt
to auto-wire first by property/field name and then by type.
Both methods and fields can be annotated. If a field is annotated Stripes will use field access to attempt to inject the bean into the field. If a method is annotated Stripes will attempt to invoke the method and supply it the value to inject. In both cases
non-public fields/methods are supported (i.e. values can be injected into private fields and through private methods).
3.@DefaultHandler
net.sourceforge.stripes.action.DefaultHandler
@Target(value={METHOD})
@Retention(value=RUNTIME)
@Documented
Marker annotation to specify that a method within an ActionBean is the default handler for events if a specific event cannot be identified.
Stripes框架核心注解
本文介绍了Stripes Web应用框架中的三个关键注解:@SessionScope用于定义会话范围内的ActionBean;@SpringBean用于注入Spring管理的Bean;@DefaultHandler用于标记默认处理方法。
1426

被折叠的 条评论
为什么被折叠?



