【发布时间】:2014-02-19 23:24:15
【问题描述】:
一个简单的问题,但不记得如何做到最好。我想要的是在代码部分运行后自动将用户发送到另一个页面"/lecturer/marking/marking-section-two"。
有没有办法在支持 bean 中做到这一点,不会影响它之前显示的 ajax 消息?
这是我正在运行的代码
public void markSectionOne() {
//supposing the data in markSectionOne is filled...
this.markingFacade.create(markSectionOne);
this.setMessage("Mark Saved");
//after saving...
markSectionOne = new Marking();
// now navigating to the next page
}
一旦它运行,我想自动导航到一个新页面。
谢谢大家
【问题讨论】:
-
将方法签名更改为
public String markSectionOne()并返回重定向结果。结果可以在<navigation-rule>部分的faces-config.xml中注册
标签: java jsf navigation