开发者

JSF Problem with using maxInactiveInterval

Folks, I'm finding that with a test value o开发者_Go百科f 1 minute expiry in web.xml the following code redirects to the given url immediately when the page is rendered:

  <meta http-equiv="refresh" content="${pageContext.session.maxInactiveInterval};url=#{facesContext.externalContext.requestContextPath}/index.xhtml"/> 

Any pointers would be appreciated.


The ${pageContext} is only available when you're using JSF on JSP. It seems that you're using JSF on JSP's successor Facelets as you're trying to redirect to a XHTML file. Facelets has totally no notion of a ${pageContext}. You should be using #{facesContext} instead. The session is then available by #{facesContext.externalContext.session}. However, Facelets offers a shorthand to get it: #{session}. The same for the #{request}.

So, this should do:

<meta http-equiv="refresh" content="#{session.maxInactiveInterval};url=#{request.contextPath}/index.xhtml"/> 
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜