q253614460 2012-04-26 17:06
浏览 497
已采纳

struts2 java注解一直出错 @Result这个应该是引用哪个包啊?

package com.test1;
import org.apache.struts2.convention.annotation.Result;
import com.opensymphony.xwork2.ActionSupport;
@Result( value="/HelloWorld.jsp",name="SUCCESS")
public class HelloWorld extends ActionSupport {
private static final String GREETING="Hello";

public String execute(){
    setCustomGreeting(GREETING+" "+getName());
    return "SUCCESS";
}

private String name;
public String getName() {
    return name;
}
public void setName(String name) {
    this.name = name;
}
public String getCustomGreeting() {
    return customGreeting;
}
public void setCustomGreeting(String customGreeting) {
    this.customGreeting = customGreeting;
}

private String customGreeting;

}

  • 写回答

2条回答 默认 最新

  • xiaofengxp 2012-04-29 22:02
    关注

    @org.apache.struts2.convention.annotation.Result

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?