Thes"> Thes" />
欢迎来到天天文库
浏览记录
ID:40534698
大小:112.50 KB
页数:20页
时间:2019-08-04
《displayTutorial向导》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、一:Simplestcase,nocolumnsBasictable<%request.setAttribute("test",newTestList(10,false));%>Thesimplestpossibleusageofthetabletagistopointthetabletagatajava.util.Listimplementationanddonothingelse.Thetabletagwilliteratethroughthelista
2、nddisplayacolumnforeachpropertycontainedintheobjects.Typically,theonlytimethatyouwouldwanttousethetaginthissimplewaywouldbeduringdevelopmentasasanitycheck.Forproduction,youshouldalwaysdefineatleastasinglecolumn.Basic,columns<%request.setAttribute("test",newT
3、estList(10,false));%>T
4、hisexamplestartstoshowyouhowtousethetabletag.Youpointthetabletagatadatasource(aList),thendefineanumberofcolumnswithpropertiesthatmaptoaccessormethods(getXXX)foreachobjectintheList.Notethatyouhaveonecolumntagforeverycolumnthatyouwanttoappearinthetable.And,the
5、columnspecifieswhatpropertyisshowninthatparticularrow.Youcandefinethecontentofacolumnbyaddingapropertyattributetothecolumntagoraddingacontenttothetag.email@it.comTherearetwowaysto
6、definethecontentofacolumn.Ofcourse,inthetagbodyyoucanusescriptletsorothercustomtags.Usingthepropertyattributetodefinethecontentofacolumnisusuallyfasterandworksbetterwithsorting.Ifyouaddapropertyattributethetagbodyisignored.Addingcontentinthecolumnbodyyoucane
7、asilyconcatenateor"decorate"fieldsavailableinobjectsinthelist.Seetheimplicitobjectschapterformoredetails.ThepropertyattributespecifieswhatgetXXXmethodiscalledoneachiteminthelist.Soforthesecondcolumn,getNameiscalled.Bydefaultthepropertynameisusedastheheaderof
8、thecolumnunlessyouexplicitlygivethecolumnatitle.二:Implicitobjectscreatedbytable
此文档下载收益归作者所有