JSF使用注意點(diǎn)
1.轉(zhuǎn)換時(shí)間時(shí),必須加上時(shí)區(qū)GMT+8,不然相差一天。
<managed-bean-name>productBean</managed-bean-name>
<managed-bean-class>demo.view.ProductBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
<managed-property>
<property-name>id</property-name>
<property-class>java.lang.Integer</property-class>
<value>#{param.id}</value>
</managed-property>
<managed-property>
<property-name>view</property-name>
<property-class>java.lang.Boolean</property-class>
<value>#{param.view}</value>
</managed-property>
</managed-bean>
String someValue = params.get("id");
這個(gè)是按參數(shù)名稱查找的
{
if (FacesContext.getCurrentInstance().getRenderResponse())
return false;
else
return true;
}
感謝 tdwebber 提供。
1) When using a jsp:include within the f:view tags, must include f:subview in the included file (or around the jsp:include tag).
當(dāng)在f:view中使用jsp:include標(biāo)簽插入一個(gè)文件時(shí),必須用f:subview把jsp:include包起來
2) In the include file, cannot have any HTML. All HTML tags must be wrapped in f:verbatim tags.
在被插入的文件中,不能有任何的html標(biāo)簽,如果必須使用html標(biāo)簽,必須用f:verbatim將它包起來。
3) Within main f:view tags however, it is not necessary to wrap everything in f:verbatim tags (it's not bad either). Just HTML that appears as children to other JSF components (i.e. t:newspaperTable).
在主f:view中,沒有必要用f:verbatim將html標(biāo)簽包起來(當(dāng)然包起來也可以)。當(dāng)html標(biāo)簽出現(xiàn)在子視圖或其它JSF部件標(biāo)簽中時(shí),就要用f:verbatim包起來。
10.JSF的緩存能力好像太強(qiáng)了,有時(shí)停止了服務(wù)器,改動(dòng)了jsp頁(yè)面中的jsf標(biāo)簽,再啟動(dòng)服務(wù)器,但到該頁(yè)面時(shí),還是原來的內(nèi)容,需要手動(dòng)刷新一下。有時(shí)需要先轉(zhuǎn)到別的頁(yè)面,再回來刷新一下才能看到更新的內(nèi)容。
posted on 2009-10-25 22:50 大魚 閱讀(196) 評(píng)論(0) 編輯 收藏 所屬分類: JSF