struts2的@AllowedMethods注解是怎么用的
展开全部
我是这么使用的,使用注解的方式 没有在Struts.xml进行action的配置,jar包换回低版本之后,讲道理是不会出现这种情况的
@Action(value="bookAction",results={@Result(name="success",location="/success.jsp")})
@AllowedMethods(value={("add"),("update"),("delete")})
public class BookAction extends BaseAction<Book> {
@Override
public String execute() throws Exception {
System.out.println(model);
bookService.save(model);
return "success";
}
public String add(){
return "success";
}
public String update(){
return "success";
}
public String delete(){
return "success";
}
@Action(value="bookAction",results={@Result(name="success",location="/success.jsp")})
@AllowedMethods(value={("add"),("update"),("delete")})
public class BookAction extends BaseAction<Book> {
@Override
public String execute() throws Exception {
System.out.println(model);
bookService.save(model);
return "success";
}
public String add(){
return "success";
}
public String update(){
return "success";
}
public String delete(){
return "success";
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询