开发者

Difference between redirect in jsf and sendRedirect in JSP

开发者 https://www.devze.com 2023-01-27 22:27 出处:网络
In my application I use JSF. I want to redirect the user to error page when their session expires. I have

In my application I use JSF. I want to redirect the user to error page when their session expires. I have tried by using <redirect /> tag in faces-config with navigation case. It's not working properly. It changes the url, but the page is not loaded for ajax requests. But if I use sendRedir开发者_StackOverflow社区ect method of HttpServletRespose Class it's working properly. What is the difference between the both?

This is the code in faces-config file,

 <navigation-rule>
    <navigation-case>
        <from-outcome>session_expired</from-outcome>
        <to-view-id>/pages/general/home.jsp</to-view-id>
        <redirect />
    </navigation-case>
</navigation-rule>

Thanks for you quick reply.

0

精彩评论

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

关注公众号