我们最近将主要平台从jsf 1.2升级到2.0.升级后,我们每小时都会收到几个ViewExpiredException错误.通过阅读该主题,似乎这是会话到期时的预期异常,但是我们已经审查了访问日志,即使请求在某些情况下仅相隔5分钟,我们也会收到这些异常.
我的问题如下:
1)除会话到期外,还有哪些其他条件可能导致ViewExpiredException?
2)我们正在记录的异常没有包含导致异常的确切条件的详细信息(缺少会话,损坏会话,无法恢复特定组件).有没有办法引入额外的日志记录来找出在每种情况下触发此异常的非常具体的情况?
Mojarra 2.0.4-b09 Tomcat 6使用Memcached Session Manager进行会话复制
任何帮助表示赞赏.谢谢!
我正在寻找一种方法将BigInteger转换为非常短的字符串(尽可能短).转换需要是可逆的.在这种情况下,转换的安全性并不是什么大问题.有人会有他们如何解决这个问题的建议或样本吗?
我试图从 JSF 中实现 301 重定向,但是当我对其进行 firebug 时,我总是看到 302 正在执行。有人能告诉我如何改变下面的方法来完成 301 吗?
/**
* Redirect to specified destination url
*
* @param destination
*/
public static void permanentRedirect(String destination) {
final ExternalContext externalContext = FacesContext.getCurrentInstance().getExternalContext();
try {
HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.setStatus(HttpServletResponse.SC_MOVED_PERMANENTLY);
if (!response.isCommitted()) {
externalContext.redirect(destination);
}
} catch (IOException e) {
LOGGER.debug("Could not redirect to " + destination);
}
}
Run Code Online (Sandbox Code Playgroud) 我有一个复合组件,看起来像这样:
<!DOCTYPE html>
<html
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:dm="http://davemaple.com/dm-taglib"
xmlns:rich="http://richfaces.org/rich"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:fn="http://java.sun.com/jsp/jstl/functions"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:a4j="http://richfaces.org/a4j">
<cc:interface>
<cc:attribute name="styleClass" />
<cc:attribute name="textBoxStyleClass" />
<cc:attribute name="inputTextId" />
<cc:attribute name="labelText" />
<cc:attribute name="tabindex" />
<cc:attribute name="required" default="false" />
<cc:attribute name="requiredMessage" />
<cc:attribute name="validatorId" />
<cc:attribute name="converterId" />
<cc:attribute name="title"/>
<cc:attribute name="style"/>
<cc:attribute name="unicodeSupport" default="false"/>
<cc:attribute name="tooltip" default="false"/>
<cc:attribute name="tooltipText" default=""/>
<cc:attribute name="tooltipText" default=""/>
<cc:attribute name="onfail" default=""/>
<cc:attribute name="onpass" default=""/>
</cc:interface>
<cc:implementation>
<ui:param name="converterId" value="#{! empty cc.attrs.converterId ? cc.attrs.converterId : 'universalConverter'}" />
<ui:param name="validatorId" value="#{! empty cc.attrs.validatorId …Run Code Online (Sandbox Code Playgroud) 今天早上我有理由尝试在inputText组件上使用多个转换器,并意识到这不起作用.
有谁为什么JSF只允许每个ValueHolder一个转换器?看起来在一些情况下使用一系列转换器会很优雅.
我有一个模态窗口,我只想在页面上的几个表单中的一个有错误时启动.有没有办法使用el来识别特定表单是否有错误?
示例伪代码:
<h:form id="form1">
</h:form>
<h:form id="form2">
</h:form>
<a4j:rendered="#{form1.hasErrors()}">
... modal here ...
</a4j:rendered>
Run Code Online (Sandbox Code Playgroud)