JavaScud | Forum | JIRA | Blog |
  Dashboard > WebWork2文档中文化计划 > ... > J2SE 5 Support > Before Annotation
  WebWork2文档中文化计划 Log In View a printable version of the current page.  
  Before Annotation
Added by scud, last edited by scud on May 17, 2006  (view change)
Labels: 
(None)

Before 标注(Annotation)

标注一个action的方法,在主action方法之前执行.

使用

Before标注可以在方法级别设置.

参数

没有参数

例子

public class SampleAction extends ActionSupport {

 @Before
 public void isAuthorized() throws AuthenticationException {
   // authorize request, throw exception if failed
 }

 public String execute() {
    // perform secure action
    return SUCCESS;
 }
}
Site running on a free Atlassian Confluence Open Source Project License granted to WebWork China. Evaluate Confluence today.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.3 Build:#808 May 29, 2007) - Bug/feature request - Contact Administrators