com.sun.faces.enableRestoreView11Compatibility 在 JSF 1.2 中使用什么
当我有 javax.faces.application.ViewExpiredException 时,我想将用户发送到登录页面。
web.xml
...
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
...
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/errors/sessionExpired.jsf</location>
</error-page>
sessionExpired.jsf
....
<c:redirect url="/index.jsf" />
但 enableRestoreView11Compatibility 是 JSF 1.1 中使用的方法,JSF 1.2 的解决方案是什么?
When I have javax.faces.application.ViewExpiredException I want to send user to login page.
web.xml
...
<context-param>
<param-name>com.sun.faces.enableRestoreView11Compatibility</param-name>
<param-value>true</param-value>
</context-param>
...
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<location>/errors/sessionExpired.jsf</location>
</error-page>
sessionExpired.jsf
....
<c:redirect url="/index.jsf" />
but enableRestoreView11Compatibility is method that was used in JSF 1.1, what is solution for JSF 1.2?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
com.sun.faces.enableRestoreView11Compatibility
是一个 JSF 1.2 设置,它告诉 JSF 1.2 的行为类似于 JSF 1.1。com.sun.faces.enableRestoreView11Compatibility
==true
表示“不要抛出ViewExpiredException
;相反,如果旧视图存在,只需创建一个新视图已经过期了。”IBM 关于 JSF 1.1 行为的注释说:
默认的 JSF 1.2 行为在规范中定义如下:
要在视图过期时引发
ViewExpiredException
,请删除com.sun.faces.enableRestoreView11Compatibility
参数或将其设置为false< /代码>。
com.sun 命名空间表明该参数是 Sun/Mojarra 和派生的特定于实现的设置,因此它可能不适用于所有 JSF 实现。
com.sun.faces.enableRestoreView11Compatibility
is a JSF 1.2 setting that tells JSF 1.2 to behave like JSF 1.1.com.sun.faces.enableRestoreView11Compatibility
==true
means "do not throw aViewExpiredException
; instead, just create a new view if the old one has expired."The IBM notes on the JSF 1.1 behaviour say:
The default JSF 1.2 behaviour is defined in the spec as this:
To have a
ViewExpiredException
thrown when the view expires, remove thecom.sun.faces.enableRestoreView11Compatibility
parameter or set it tofalse
.The
com.sun
namespace suggests that the parameter is a Sun/Mojarra and derived implementation-specific setting, so it probably will not work with all JSF implementations.