当我操作了一个方法后,返回SUCCESS时,好像一直都是执行的execute中指定的success跳转地址list.jsp
比如我执行了test!edit.action,本来返回success的话,就应该跳转到edit.jsp页面,可偏偏跳转的是list.jsp
这是为什么呢?
下面是我的类:public class TestAction extends ActionSupport { 。
@Autowired
。。(省略) @Action(value = "/test", results = {
@Result(name = "success", location = "/list.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String execute() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/list.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String list() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/save.jsp"),
@Result(name = "input", location = "/add.jsp") })
// type="ActionChainResult.class", prams={"method","list"}
public String save() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/del.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String del() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/edit.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String edit() throws Exception {
return SUCCESS;
}}
比如我执行了test!edit.action,本来返回success的话,就应该跳转到edit.jsp页面,可偏偏跳转的是list.jsp
这是为什么呢?
下面是我的类:public class TestAction extends ActionSupport { 。
@Autowired
。。(省略) @Action(value = "/test", results = {
@Result(name = "success", location = "/list.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String execute() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/list.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String list() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/save.jsp"),
@Result(name = "input", location = "/add.jsp") })
// type="ActionChainResult.class", prams={"method","list"}
public String save() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/del.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String del() throws Exception {
return SUCCESS;
}
@Action(value = "/test", results = {
@Result(name = "success", location = "/edit.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String edit() throws Exception {
return SUCCESS;
}}
解决方案 »
- jsp中如何实现分页显示
- petstore2 没法下?
- Spring <aop:aspectj-autoproxy>
- spring整合struts 启动tomcat出错 配置如下 高手帮下我这菜鸟!
- 在netbeans中,用JAX-WS做的Web Services 部署参数类型怎么定呀
- 小妹请教HTML的CHECKBOX点击三下怎样打上叉,不知道给多少分随便发了!
- 请问现在用struts开发网站时,页面是直接一行一行手写,还是先写好html代码再改,还是有特别的工具直接调用标签库写页面??????
- >琴声刺骨<--当我埋头于JSP,EJB,STRUTS的时候,她在...分多无用,散!进来有分!
- myeclipse软件自动把JAVA文件编译到bin下生成.class文件怎么不实时啊
- 求大神帮忙!!javaweb项目报错:找不到或无法加载主类 enable
- ERP系统寻求团队或个人合作
- MyEclipse6.0启动的奇怪问题 大家都帮我看看吧 O(∩_∩)O谢谢
@Result(name = "success", location = "/list.jsp"),
@Result(name = "input", location = "/failure.jsp") })
public String execute() throws Exception {
return SUCCESS;
}此方法省略。