开发者

How to use jsf "navigation-rule" for direct non .jsf pages ("to-view-id" is not .jsf)

开发者 https://www.devze.com 2023-04-02 23:57 出处:网络
I want to direct \"from-outcome\" to some BIRT report file (with .rptdesign extension) but it append extension as .jsf. My navigation rule is,

I want to direct "from-outcome" to some BIRT report file (with .rptdesign extension) but it append extension as .jsf. My navigation rule is,

<!-- 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&amp;__overwrite=true&amp;</to-view-id>
        <redirect>
            <view-param>
                <name>Job Location</name>
                <value>#{homeController.jobLocation}</value>
            </view-param>
        </redirect>
    </navigation-case>
</navigation-rule>

Then I got result URL as, http://192.168.3.111:8080/imc-report-system-1.0/frameset开发者_JAVA百科?__report=report%2Fnew_report_group.jsf&Job%20Location=abc but it should be as, http://192.168.3.111:8080/imc-report-system-1.0/frameset?__report=report%2Fnew_report_group.rptdesign&Job%20Location=abc Thanks.


You can't navigate to a non-JSF-view by a JSF navigation case.

Redirect yourself using ExternalContext#redirect().

public void submit() {
    // ...

    String url = "frameset"
        + "?__report=report%2Fnew_report_group.rptdesign"
        + "&amp;__overwrite=true"
        + "&amp;Job%20Location=" + jobLocation;

    FacesContext.getCurrentInstance().getExternalContext().redirect(url);
}
0

精彩评论

暂无评论...
验证码 换一张
取 消