日期:2014-05-16  浏览次数:20448 次

JSF2 点滴积累
1. 设置<h:inputHidden ... />
xhtml:
<h:inputHidden value="0" binding="{mailDownLoadManaged.updateDownloadTimes}">
</h:inputHidden>

java:
private HtmlInputHidden updateDownloadTimes;
Integer values=Integer.valueOf(updateDownloadTimes.getValue().toString()) ;
boolean isUpdateDownloadTimes = values == 1 ? true : false;


[b]2. xhtml 中javascript使用 ‘&’ 报错:the entity name must immediately follow the '&' in the entit  [b]

if ("#{uploadResultManagedBean.endFlag}" != "true" && "#{uploadResultManagedBean.cancelFlag}" != "1")


修改为
if ("#{uploadResultManagedBean.endFlag}" != "true" &amp;&amp; "#{uploadResultManagedBean.cancelFlag}" != "1")


或者(其实,有许多JS代码会有问题,都可以使用如下写法)

<script type="text/javascript">
//<![CDATA[
//]]>
</script>