我想将“from-outcome”指向某个BIRT报告文件(扩展名为.rptdesign),但它将扩展名附加为.jsf。我的导航规则是,
<!-- home.xhtml page -->
<navigation-rule>
<from-view-id>/home.xhtml</from-view-id>
<!-- navigate to group report -->
<navigation-case>
<from-outcome>GROUP_REPORT</from-outcome>
<to-view-id>frameset?__report=report/new_report_group.rptdesign&__overwrite=true&</to-view-id>
<redirect>
<view-param>
<name>Job Location</name>
<value>#{homeController.jobLocation}</value>
</view-param>
</redirect>
</navigation-case>
</navigation-rule>
然后我得到结果URL为, http://192.168.3.111:8080/imc-report-system-1.0/frameset?__report=report%2Fnew_report_group.jsf&Job%20Location=abc 但它应该是, http://192.168.3.111:8080/imc-report-system-1.0/frameset?__report=report%2Fnew_report_group.rptdesign&Job%20Location=abc 感谢。
答案 0 :(得分:4)
您无法通过JSF导航案例导航到非JSF视图。
使用ExternalContext#redirect()
重定向自己。
public void submit() {
// ...
String url = "frameset"
+ "?__report=report%2Fnew_report_group.rptdesign"
+ "&__overwrite=true"
+ "&Job%20Location=" + jobLocation;
FacesContext.getCurrentInstance().getExternalContext().redirect(url);
}