- 1、本文档共13页,可阅读全部内容。
- 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
Jsf
Jsf标签详解(全)
actionListener
f:actionListener标签为h:commandLink,h:commandButton等指定自定义的事件侦听类。
f:actionListener使用:JSP:
h:commandButtonid=registvalue=Regist
f:actionListenertype=mypackage.ActionListenerImpl/f:actionListener
/h:commandButton
attribute
attribute
f:attribute标签用来设置父标签的属性。f:attribute标签使用例:
JSP:
h:graphicImageurl=/images/picture.jpg
f:attributename=heightvalue=20/
f:attributename=widthvalue=10/
/h:graphicImage
convertDateTime
convertDateTime
f:convertDateTime标签用来转换日期格式。
示范代码:
h:outputTextvalue=#{bean.outputDate}
f:convertDateTimepattern=yyyy年MM月dd日/
/h:outputText
converter
converter
JSF可以使用f:converter简单地调用指定onverter-id的JSFConverter实现(实现javax.faces.convert.Converter接口的类)对JSF组件组件的输入输出值加以变换。
示范代码:
h:inputTextvalue=123456
f:converterconverterId=myConverterId/
/h:inputText
convertNumber
convertNumber
f:convertNumber用来对数字,通货等等进行格式转换示范代码:
h:inputTextvalue=123456
f:convertNumbertype=currencycurrencySymbol=$/
/h:inputText
facet
facet
f:facet标签用来为包含f:facet标签的父组件与被f:facet标签所包含的子组件之间申明一种特殊的关系。常与h:panelGrid,h:dataTable等标签连用,申明组件为标题或页脚。示范代码:
f:facetname=header
h:outputTextvalue=Title/
/f:facet
loadBundle
loadBundle
f:loadBundle是JSF提供的一个支持JSP本地化(多语言支持)操作的标签。示范代码:
f:loadBundlebasename=com.test.resource.Messagesvar=msg/
param
param
f:param用于向组件添加参数。一般用法主要有2种:
h:outputLinkvalue=/someUrl
f:paramname=idvalue=#{bean.id}/
f:paramname=namevalue=#{}/
/h:outputLink
或h:outputFormatvalue=Youhave{0}itemsinyourshoppingcart.
f:paramvalue=#{SessionBean1.cart.itemCount}/
/h:outputFormat
selectItem
selectItem
f:selectItem指定UISelectOne或UISelectMany组件的一个项目,用来为
h:selectOneMenu等选择性组件设置选择数据项。示范代码:
h:selectOneMenuvalue=#{bean.selectedItemValue}
f:selectItemitemLabel=Label1value=0/
f:selectItemitemLabel=Label2value=1/
/h:selectOneMenu
selectItems
selectItems
f:selectItems用于指定UISelectOne或UISelectMany组件的多个项目,
与f:selectItem标签一样,用来为
h:selectManyCheckbox
h:selectManyListbox
h:selectManyMenu
h:selectOneLis
文档评论(0)