ITeye博客

struts2 helloworld

ayaya · 2009-03-16 15:32 · SSH · Markdown

HelloWorld.jsp <%@ taglib prefix="s" uri="/struts-tags" %>

package tutorial; import com.opensymphony.xwork2.ActionSupport; public class HelloWorld extends ActionSupport {

public static final String MESSAGE = "Struts is up and running ...";

public String execute() throws Exception {
    setMessage(MESSAGE);
    return SUCCESS;
}

private String message;

public void setMessage(String message){
    this.message = message;
}

public String getMessage() {
    return message;
}

}

修改struts.xml文件:

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。