锘??xml version="1.0" encoding="utf-8" standalone="yes"?>久久精品亚洲日本波多野结衣,中文字幕亚洲精品无码,老色鬼久久亚洲AV综合http://www.tkk7.com/RongHao/archive/2006/11/27/83858.htmlronghaoronghaoMon, 27 Nov 2006 10:51:00 GMThttp://www.tkk7.com/RongHao/archive/2006/11/27/83858.htmlhttp://www.tkk7.com/RongHao/comments/83858.htmlhttp://www.tkk7.com/RongHao/archive/2006/11/27/83858.html#Feedback1http://www.tkk7.com/RongHao/comments/commentRss/83858.htmlhttp://www.tkk7.com/RongHao/services/trackbacks/83858.html鑰冭檻涓涓唴瀹硅妭鐐笴ontent,鍏朵腑鑺傜偣鏈変釜pagecontent鐨勫睘鎬э紝榪欎釜灞炴х敤鏉ュ瓨鍌ㄧ敤鎴峰湪鍚庡彴杈撳叆鐨勫唴瀹癸紝
鍐呭+妯℃澘=鏄劇ず錛岃繖閲屾槸錛?br />鍐呭+妯℃澘-->鏄劇ず闈欐乭tml
鍐呭鐢‵CK鏉ョ紪杈戯紝妯℃澘涔熷悓鏍風(fēng)敤FCK緙栬緫錛岃繖閲岀敤freemarker鏃犵枒鏄竴涓ソ鐨勯夋嫨銆傝繖閲屾槸涓渶綆鍗曠殑渚嬪瓙銆?br />棣栧厛瀹氫箟涓涓渶綆鍗曠殑妯℃澘content.ftl
<html>
$
{content}
</html>
鐒跺悗灝辨槸鎶婂唴瀹瑰~鍏呰繘鍘伙細(xì)
聽Configuration聽cfg聽=new聽Configuration();
//妯℃澘瀛樺偍鐨勭洰褰?/span>
聽cfg.setDirectoryForTemplateLoading(Path.getTemplateDirectory());
//榛樿
聽cfg.setObjectWrapper(new聽DefaultObjectWrapper());
//濉厖鏁版嵁聽聽聽聽聽聽聽聽
Map聽root聽=new聽HashMap();
root.put(
"content",聽c.getPageContent());
聽聽聽聽聽Template聽temp聽
=聽cfg.getTemplate("content.ftl");
//鍙戝竷鏃ユ湡
String聽date=c.getActivedate();
String聽filename聽
=聽c.getId()+".html";
//鍒涘緩鐩綍
Path.createFold(Path.getWebCmsHtmlDirPath(),date);
Writer聽out聽
=new聽OutputStreamWriter(new聽FileOutputStream(Path.getWebCmsHtmlDirPath()+"/"+date+"/"+filename));
temp.process(root,聽out);
out.flush();
鍏跺疄灝辨槸榪欎箞綆鍗曪紒瀵筯tml鐨勭鐞嗗氨寰堝鏄撲簡錛屽熀鏈殑FILE鎿嶄綔

ronghao 2006-11-27 18:51 鍙戣〃璇勮
]]>
欏甸潰鏍囩tld浣嶇疆http://www.tkk7.com/RongHao/archive/2006/10/12/74798.htmlronghaoronghaoThu, 12 Oct 2006 07:50:00 GMThttp://www.tkk7.com/RongHao/archive/2006/10/12/74798.htmlhttp://www.tkk7.com/RongHao/comments/74798.htmlhttp://www.tkk7.com/RongHao/archive/2006/10/12/74798.html#Feedback0http://www.tkk7.com/RongHao/comments/commentRss/74798.htmlhttp://www.tkk7.com/RongHao/services/trackbacks/74798.htmlJsp涓潪甯哥畝鍗曪細(xì)
<%@ taglib prefix="authz" uri="浣嗚寰楄嚜宸辨病鏈夊湪web.xml涓0鏄庤繖涓爣絳撅紝鍜嬪氨璺戣搗鏉ヤ簡鍛紵google涓涓嬶紝鍘熸潵authz.tld琚墦鍏ar鍖呯殑META-INF涓?br />鍛靛懙錛岃褰曚竴涓?img src ="http://www.tkk7.com/RongHao/aggbug/74798.html" width = "1" height = "1" />

ronghao 2006-10-12 15:50 鍙戣〃璇勮
]]>
webwork淇濆瓨鍥劇墖鍒版暟鎹簱http://www.tkk7.com/RongHao/archive/2006/06/15/53030.htmlronghaoronghaoThu, 15 Jun 2006 09:14:00 GMThttp://www.tkk7.com/RongHao/archive/2006/06/15/53030.htmlhttp://www.tkk7.com/RongHao/comments/53030.htmlhttp://www.tkk7.com/RongHao/archive/2006/06/15/53030.html#Feedback0http://www.tkk7.com/RongHao/comments/commentRss/53030.htmlhttp://www.tkk7.com/RongHao/services/trackbacks/53030.html

寮鍙戜腑閬囧埌榪欎箞涓涓姹傦紝鐢ㄦ埛USER榪欎釜PO閲岄渶瑕佷繚瀛樼敤鎴風(fēng)殑鐓х墖銆備竴鑸儏鍐典笅鏈変袱縐嶅鐞嗘柟娉曪細(xì)涓鏄洿鎺ヤ繚瀛樺浘鐗囧埌鏁版嵁搴擄紱浜屾槸淇濆瓨鍥劇墖鍒版湇鍔″櫒绔紝PO瀛楁淇濆瓨涓涓仈鎺ャ傝冭檻鍒扮敤鎴風(fēng)収鐗囦竴鑸緝?yōu)畯锛岄噰鐢ńW竴縐嶆柟娉曘?br />

聽1 public class 聽User聽 extends 聽Principal聽 {
聽2 聽聽聽聽 private byte []聽photo;聽聽聽 // 鑰冭檻涓庡悇縐嶆暟鎹簱鍏煎闂
聽3 聽聽聽聽 public byte []聽getPhoto()聽 {
聽4 聽聽聽聽聽聽聽聽 return 聽photo;
聽5 聽聽聽聽}

聽6
聽7 聽聽聽聽 public void 聽setPhoto( byte []聽photo)聽 {
聽8 聽聽聽聽聽聽聽聽 this .photo聽 = 聽photo;
聽9 聽聽聽聽}

10 聽聽聽聽..
11 }

12


欏甸潰閲岄潰錛岀洿鎺ョ敤webwork鐨凢ileUploadInterceptor鎷︽埅

< @ww.form聽聽enctype = " multipart/form-data " 聽action = " doUpdateUser " 聽聽method = " post " >
< image聽name = " img1 " 聽src = " /getUserPhoto.action?userId=${user.id} " 聽width = 90 聽height = 120 聽border = " 0 " ></ image >
< @ww.file聽label = " %{getText('user.photo')} " 聽name = " photo " />
</ @ww.form >


xwork.xml閲岀殑閰嶇疆

聽聽聽聽聽聽聽 < action聽name = " doUpdateUser " class = " com.ronghao.organization.action.OrganizationAction " 聽method = " updateUser " >
聽聽聽聽聽聽聽聽聽聽聽聽
< interceptor - ref聽name = " defaultStack " >
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
< param聽name = " fileUpload.allowedTypes " >
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽image
/ x - png,image / gif,image / pjpeg
聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽
</ param >
聽聽聽聽聽聽聽聽聽聽聽聽
</ interceptor - ref >
聽聽聽聽聽聽聽聽聽聽聽聽
< result聽name = " success " >/ organization / user.ftl </ result >
聽聽聽聽聽聽聽聽
</ action >

聽聽聽聽聽聽聽聽
< action聽name = " getUserPhoto " class = " com.ronghao.organization.action.OrganizationAction " 聽method = " getUserPhoto " >
聽聽聽聽聽聽聽聽聽聽聽聽
< result >/ organization / user.ftl </ result >
聽聽聽聽聽聽聽聽
</ action >


寮曠敤榛樿鐨勬嫤鎴櫒鏍堬紝鏍堥噷宸茬粡鍖呭惈FileUploadInterceptor鎷︽埅錛岃繖閲岄厤緗瓼ileUploadInterceptor鎷︽埅鐨勫弬鏁幫紝璁懼畾涓婁紶鐨勬枃浠朵負(fù)鍥劇墖
鏍煎紡
Action綾?br />

聽1 public class 聽OrganizationAction聽 extends 聽BaseOrganizationAction {
聽2 聽聽聽聽 private 聽File聽photo;聽聽 // 涓庨〉闈㈤噷鐨勪笂浼犳枃浠跺瓧孌靛悕瀵瑰簲
聽3 聽聽聽聽 private 聽OutputStream聽outPhoto
聽4
聽5 聽聽聽聽聽 /**
聽6 聽聽聽聽聽*聽鏇存柊鐢ㄦ埛淇℃伅
聽7 聽聽聽聽聽*
聽8 聽聽聽聽聽*聽 @return
聽9 聽聽聽聽聽*聽 @throws 聽Exception
10 聽聽聽聽聽 */

11 聽聽聽聽 public 聽String聽updateUser()聽 throws 聽Exception聽 {
12 聽聽聽聽聽聽聽聽 // 浠ヤ笅涓轟繚瀛樺浘鐗?瑙嗘儏鍐典慨鏀?/span>
13 聽聽聽聽聽聽聽聽 if 聽( null != 聽photo)聽 {
14 聽聽聽聽聽聽聽聽聽聽聽聽FileInputStream聽file聽 = new 聽FileInputStream(photo);
15 聽聽聽聽聽聽聽聽聽聽聽聽 int 聽length聽 = 聽file.available();
16 聽聽聽聽聽聽聽聽聽聽聽聽 byte []聽buffer聽 = new byte [length];
17 聽聽聽聽聽聽聽聽聽聽聽聽file.read(buffer);
18 聽聽聽聽聽聽聽聽聽聽聽聽file.close();
19 聽聽聽聽聽聽聽聽聽聽聽聽user.setPhoto(buffer);聽聽聽 // 灝嗕笂浼犵殑鍥劇墖杞崲涓哄瓧鑺傛暟緇勫瓨鍌ㄥ埌PO涓?/span>
20 聽聽聽聽聽聽聽聽}

21 聽聽聽聽聽聽聽聽organizationService.updateUser(user);
22 聽聽聽聽聽聽聽聽 return 聽SUCCESS;
23 聽聽聽聽}

24
25 聽聽聽聽 public 聽String聽getUserPhoto()聽 throws 聽Exception聽 {
26 聽聽聽聽聽聽聽聽user聽 = 聽organizationService.getUserById(userId);
27 聽聽聽聽聽聽聽聽 if 聽(user.getPhoto()聽 != null )聽 {
28 聽聽聽聽聽聽聽聽聽聽聽聽outPhoto聽 = this .getResponse().getOutputStream();聽 // 灝哖O涓瓧鑺傛暟緇勮漿鎹負(fù)杈撳嚭嫻?/span>
29 聽聽聽聽聽聽聽聽聽聽聽聽outPhoto.write(user.getPhoto());
30 聽聽聽聽聽聽聽聽聽聽聽聽outPhoto.flush();
31 聽聽聽聽聽聽聽聽聽聽聽聽outPhoto.close();
32 聽聽聽聽聽聽聽聽}

33 聽聽聽聽聽聽聽聽 return 聽SUCCESS;
34 聽聽聽聽}

35 }

36


榪欐牱灝監(jiān)K浜嗭紝鑰冭檻涓涓棶棰橈紝灝辨槸action 蹇呴』瑕佹寚瀹氫竴涓猺esult 錛屽疄闄呰繖閲岀殑鍥劇墖鏄劇ず浠呬粎鏄涓涓緭鍑烘祦

< image聽name = " img1 " 聽src = " /getUserPhoto.action?userId=${user.id} " 聽width = 90 聽height = 120 聽border = " 0 " ></ image >


鑰屾垜鐨勯厤緗噷闈㈡槸

< result >/ organization / user.ftl </ result >


涓嶇煡閬撹繖浼?xì)涓嶄細(xì)鏈変粈涔堝獎鍝嶃傛垨鑰呰繖鏍鳳紵

< result >/ organization / blank.ftl </ result >


ronghao 2006-06-15 17:14 鍙戣〃璇勮
]]>
鐢═omcat瀹炵幇瀹瑰櫒鍐呰璇?/title><link>http://www.tkk7.com/RongHao/archive/2005/12/28/25714.html</link><dc:creator>ronghao</dc:creator><author>ronghao</author><pubDate>Wed, 28 Dec 2005 06:00:00 GMT</pubDate><guid>http://www.tkk7.com/RongHao/archive/2005/12/28/25714.html</guid><wfw:comment>http://www.tkk7.com/RongHao/comments/25714.html</wfw:comment><comments>http://www.tkk7.com/RongHao/archive/2005/12/28/25714.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.tkk7.com/RongHao/comments/commentRss/25714.html</wfw:commentRss><trackback:ping>http://www.tkk7.com/RongHao/services/trackbacks/25714.html</trackback:ping><description><![CDATA[<P><STRONG>鍦ㄦ暟鎹簱閲屾柊寤轟袱涓〃</STRONG><BR>A銆佺敤鎴瘋〃<BR>create table users (user_name varchar(20) not null, <BR>                               user_pass varchar(20) not null, <BR>                               PRIMARY KEY (user_name)) ;<BR>B銆佺敤鎴蜂笌瑙掕壊鍏寵仈琛?BR>create table user_roles (user_name varchar(20) not null,<BR>                                        role_name varchar(20) not null, <BR>                                        PRIMARY KEY (user_name)) ;<BR>C銆佹彃鍏ユ暟鎹?BR>insert into users values('user1', 'password');<BR>insert into user_roles values('user1', 'manager');</P> <P><STRONG>鍦╰omcat鐨剆erver.xml閲屽姞鍏ユ弿榪?BR></STRONG>      <Realm  className="org.apache.catalina.realm.JDBCRealm"<BR>              driverName="org.gjt.mm.mysql.Driver"<BR>              connectionURL="jdbc:mysql://localhost/databaseName"<BR>              connectionName=yourname connectionPassword=yourpassword<BR>              userTable="users" userNameCol="user_name" userCredCol="user_pass"<BR>              userRoleTable="user_roles" roleNameCol="role_name" /></P> <P><STRONG>鍦ㄨ嚜宸卞簲鐢ㄧ▼搴忕殑web.xml閲屽姞鍏ユ弿榪幫紙鍩轟簬琛ㄥ崟錛?/STRONG><BR><security-constraint><BR>  <web-resource-collection><BR>   <web-resource-name>My Test</web-resource-name><BR>   <url-pattern>/get.jsp</url-pattern><BR>  </web-resource-collection><BR>  <auth-constraint><BR>    <role-name>manager</role-name>    //鑳藉璁塊棶鐨勮鑹詫紝鍙互澶氫釜<BR>  </auth-constraint><BR></security-constraint></P> <P><login-config><BR>銆銆<auth-method>FORM</auth-method><BR>    <realm-name>My Test</realm-name><BR>銆銆<form-login-config><BR>銆銆<form-login-page>/login.jsp</form-login-page><BR>銆銆<form-error-page>/fail_login.html</form-error-page>  //璁よ瘉澶辮觸鍚庤煩杞殑欏甸潰<BR>銆銆</form-login-config><BR></login-config></P> <P><STRONG>鐧誨綍琛ㄥ崟蹇呴』鍖呭惈杈撳叆鐢ㄦ埛濮撳悕鍜屽彛浠ょ殑瀛楁錛屽畠浠繀欏昏鍒嗗埆鍛藉悕涓簀_username鍜宩_password錛岃〃鍗曞皢榪欎簩涓煎彂閫佺粰j_security_check閫昏緫鍚嶅瓧銆?/STRONG><BR>銆銆涓嬮潰鏄竴涓琛ㄥ崟濡備綍鍦℉TML緗戦〉涓疄鐜扮殑渚嬪瓙錛?BR><form method="POST" action="j_security_check"><BR>銆銆<input  type="text" name="j_username"><BR>銆銆<input  type="password" name="j_password"><BR>    <input  type="submit" value="紜畾"/><BR></form> </P> <P>榪欐牱褰撳get.jsp榪涜璁塊棶鏃訛紝tomcat灝變細(xì)鑷姩杞埌l(fā)ogin.jsp欏甸潰瀹炵幇璁よ瘉銆傚浜庣畝鍗曠殑璁よ瘉錛屽皬鍨嬬郴緇燂紝閲囩敤Tomcat瀹炵幇瀹瑰櫒鍐呰璇佹槸鏂逛究鐨勩?/P><img src ="http://www.tkk7.com/RongHao/aggbug/25714.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.tkk7.com/RongHao/" target="_blank">ronghao</a> 2005-12-28 14:00 <a href="http://www.tkk7.com/RongHao/archive/2005/12/28/25714.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>DisplayTag搴旂敤http://www.tkk7.com/RongHao/archive/2005/12/08/22990.htmlronghaoronghaoThu, 08 Dec 2005 08:10:00 GMThttp://www.tkk7.com/RongHao/archive/2005/12/08/22990.htmlhttp://www.tkk7.com/RongHao/comments/22990.htmlhttp://www.tkk7.com/RongHao/archive/2005/12/08/22990.html#Feedback18http://www.tkk7.com/RongHao/comments/commentRss/22990.htmlhttp://www.tkk7.com/RongHao/services/trackbacks/22990.html  DisplayTag鏄竴涓潪甯稿ソ鐢ㄧ殑琛ㄦ牸鏄劇ず鏍囩錛岄傚悎MVC妯″紡錛屽叾涓婚〉鍦?A >http://displaytag.sourceforge.net 
涓銆佹渶綆鍗曠殑鎯呭喌錛屾湭浣跨敤<display:column/>鏍囩
  <%request.setAttribute( "test", new ReportList(6) );%>
  <display:table name="test" />
  鏍囩閬嶅巻List閲岀殑姣忎竴涓璞★紝騫跺皢瀵硅薄閲岀殑鎵鏈夊睘鎬ф樉紺哄嚭鏉ャ備竴鑸敤浜庡紑鍙戠殑鏃跺欐鏌ュ璞℃暟鎹殑瀹屾暣鎬с?BR> 
浜屻佷嬌鐢?lt;display:column/>鏍囩鐨勬儏鍐?/STRONG>
<display:table name="test">
  <display:column property="id" title="ID" />
  <display:column property="name" />
  <display:column property="email" />
  <display:column property="status" />
  <display:column property="description" title="Comments"/>
</display:table>
   property瀵瑰簲List閲屽璞$殑灞炴э紙鐢╣etXXX()鏂規(guī)硶鍙栧緱錛夛紝title鍒欏搴旇〃鏍艱〃澶撮噷鐨勫垪鍚嶃傚畾涔夊垪鏈変袱縐嶆柟寮忥細(xì)
   A銆?lt;display:column property="email" />
      浣跨敤<display:column/>鏍囩閲岀殑property灞炴ф潵瀹氫箟
   B銆?lt;display:column title="email">email@it.com</display:column>
      鍦?lt;display:column/>鏍囩浣撻噷澧炲姞鍐呭錛屽彲浠ユ槸甯擱噺錛屼篃鍙互鐢ㄥ叾浠栨爣絳劇瓑絳?BR>   涓ょ鏂瑰紡姣旇緝錛岀敤property灞炴ф潵瀹氫箟鏇村姞蹇熷拰鍒╀簬鎺掑簭銆?BR>  
涓夈佽〃鏍兼樉紺烘牱寮忕殑瀹氫箟
  A銆佸湪<display:table/>鍜?lt;display:column/>鏍囩閲屾寚瀹氭爣鍑嗙殑html灞炴э紝鐑︾悙
  B銆佷慨鏀規(guī)牱寮忚〃
<display:table name="test" class="mars">
  <display:column property="id" title="ID" class="idcol"/>
  <display:column property="name" />
  <display:column property="email" />
  <display:column property="status" class="tableCellError" />
  <display:column property="description" title="Comments"/>
</display:table>
   閫氳繃class灞炴ф潵鎸囧畾鎵瑕佸簲鐢ㄧ殑鏍峰紡銆傚彲浠ュ湪鍏墮粯璁ゆ牱寮忚〃閲岋紙./css/screen.css錛夌洿鎺ヤ慨鏀?BR>  
鍥涖佹爣絳懼彇寰楁暟鎹殑鏁版嵁婧?BR>  鏈夊洓縐嶈寖鍥?BR>   pageScope
   requestScope (榛樿)  <display:table name="test2" >
   sessionScope  <display:table name="sessionScope.holder.list" > 娉ㄦ剰錛岃繖閲岃鎸囧畾鑼冨洿錛岄潪榛樿
   applicationScope
  
浜斻侀氳繃澧炲姞id灞炴у垱寤洪殣鍚殑瀵硅薄
<display:table name="test" id="testit">
    <display:column property="id" title="ID" />
    <display:column property="name" />
    <display:column title="static value">static</display:column>
    <display:column title="row number (testit_rowNum)"><%=pageContext.getAttribute("testit_rowNum")%></display:column>
    <display:column title="((ListObject)testit).getMoney()"><%=((ListObject)pageContext.getAttribute("testit")).getMoney()%></display:column>
</display:table>
   娉ㄦ剰鍒板湪<display:table/>閲屽鍔犱簡id灞炴э紝榪欐椂灝卞湪page context閲屽垱寤轟簡涓涓殣鍚璞★紝鎸囧悜List閲岀殑褰撳墠瀵硅薄錛?BR>   鍙互閫氳繃(ListObject)pageContext.getAttribute("id")鏉ユ崟鑾瘋繖涓璞°傚悓鏃惰繕鍒涘緩浜嗕竴涓猧d_rowNum瀵硅薄錛屽悓鏍鳳紝鍙?BR>   閫氳繃pageContext.getAttribute("testit_rowNum")鏉ユ崟鑾鳳紝瀹冧粎浠呬唬琛ㄥ綋鍓嶈鐨勮鏁般?BR>   鏈変簡榪欎袱涓殣鍚璞★紝灝卞彲浠ラ氳繃鍏朵粬鏍囩鏉ヨ闂紝渚嬪Jstl:
  <display:table id="row" name="mylist">
    <display:column title="row number" >
      <c:out value="${row_rowNum}"/>
    </display:column>
    <display:column title="name" >
      <c:out value="${row.first_name}"/>
      <c:out value="${row.last_name}"/>
    </display:column>
  </display:table>
 
鍏佹樉紺洪儴鍒嗘暟鎹?/STRONG>
   鏄劇ず寮濮嬩簲鏉℃暟鎹細(xì)閫氳繃璁懼畾length灞炴?BR><display:table name="test" length="5">
  <display:column property="id" title="ID" />
  <display:column property="email" />
  <display:column property="status" />
</display:table>
   鏄劇ず絎笁鍒扮鍏潯鏁版嵁錛氶氳繃璁懼畾offset鍜宭ength灞炴?BR><display:table name="test" offset="3" length="5">
  <display:column property="id" title="ID" />
  <display:column property="email" />
  <display:column property="status" />
</display:table> 

涓冦佸email鍜寀rl鍦板潃鐨勭洿鎺ヨ繛鎺?/STRONG>
 <display:table name="test" >
  <display:column property="id" title="ID" />
  <display:column property="email" autolink="true" />
  <display:column property="url" autolink="true" />
 </display:table>
 濡傛灉瑕佹樉紺虹殑瀵硅薄閲屽寘鍚玡mail鍜寀rl鍦板潃錛屽垯鍙互鍦╠isplay:column閲岀洿鎺ヨ瀹歛utolink="true"鏉ョ洿鎺ヨ繛鎺?BR> 
鍏佷嬌鐢ㄨ楗版ā寮忚漿鎹㈡暟鎹樉紺猴紙鍐欒嚜宸辯殑 decorator 錛?/STRONG>
  A銆佸鏁翠釜琛ㄦ牸搴旂敤decorator
  <display:table name="test" decorator="org.displaytag.sample.Wrapper" >
      <display:column property="id" title="ID" />
      <display:column property="email" />
      <display:column property="status" />
      <display:column property="date" />
      <display:column property="money" />
  </display:table>
    org.displaytag.sample.Wrapper鍗寵嚜宸卞啓鐨刣ecorator錛屽畠瑕佺戶鎵縏ableDecorator綾伙紝鐪嬬湅瀹冪殑涓涓柟娉曪細(xì)
        public String getMoney()
    {
        return this.moneyFormat.format(((ListObject) this.getCurrentRowObject()).getMoney());
    }
    寰堟槑鏄撅紝瀹冮氳繃鐖剁被鐨刧etCurrentRowObject()鏂規(guī)硶鑾峰緱褰撳墠瀵硅薄錛岀劧鍚庡鍏秅etMoney()鏂規(guī)硶榪涜鈥樻補婕嗏?BR>  B銆佸鍗曠嫭鐨刢olumn搴旂敤decorator
  <display:table name="test">
     <display:column property="id" title="ID" />
     <display:column property="email" />
     <display:column property="status" />
     <display:column property="date" decorator="org.displaytag.sample.LongDateWrapper" />
  </display:table>
    org.displaytag.sample.LongDateWrapper瑕佸疄鐜癈olumnDecorator鎺ュ彛錛屽畠鐨勬柟娉曪細(xì)
        public final String decorate(Object columnValue)
    {
        Date date = (Date) columnValue;
        return this.dateFormat.format(date);
    }
    鏄劇劧錛屽畠鑾峰緱涓嶄簡褰撳墠瀵硅薄錛堝洜涓哄畠瀹炵幇鐨勬槸鎺ュ彛錛夛紝浠呬粎鏄幏寰楄瀵硅薄鐨刢olumnValue錛岀劧鍚庘樻補婕嗏?BR>   
涔?jié)銆佸垱寤哄姩鎬佽繛鎺?BR>   鏈変袱縐嶆柟娉曞垱寤哄姩鎬佽繛鎺ワ細(xì)
   A銆佸湪<display:column/>閲岄氳繃澧炲姞href銆乸aramId銆乸aramName銆乸aramScope銆乸aramProperty灞炴?BR>      href             鍩烘湰鐨刄RL 鍦板潃
      paramId          鍔犲湪URL 鍦板潃鍚庣殑鍙傛暟鍚嶇О
      paramName        鏁版嵁bean鐨勫悕縐幫紝涓鑸負(fù)null錛堝嵆浣跨敤褰撳墠List閲岀殑瀵硅薄錛?BR>      paramScope       鏁版嵁bean鐨勮寖鍥達(dá)紝涓鑸負(fù)null
      paramProperty    鏁版嵁bean鐨勫睘鎬у悕縐幫紝鐢ㄦ潵濉厖URL 鍦板潃鍚庣殑鍙傛暟鍊?BR><display:table name="sessionScope.details">
  <display:column property="id" title="ID" href="details.jsp" paramId="id" />
  <display:column property="email" href="details.jsp" paramId="action" paramName="testparam" paramScope="request" />
  <display:column property="status" href="details.jsp" paramId="id" paramProperty="id" />
</display:table> 
    榪欑鏂規(guī)硶綆渚跨洿鎺ワ紝浣嗙己鐐規(guī)槸鏃犳硶浜х敓綾諱技details.jsp?id=xx&action=xx鐨勫鍚圲RL
   B銆佸簲鐢╠ecorator 鍒涘緩鍔ㄦ佽繛鎺ワ細(xì)
<display:table name="sessionScope.details" decorator="org.displaytag.sample.Wrapper" >
  <display:column property="link1" title="ID" />
  <display:column property="email" />
  <display:column property="link2" title="Actions" />
</display:table>
   org.displaytag.sample.Wrapper閲岀殑鏂規(guī)硶錛?BR> public String getLink1()
 {
  ListObject lObject= (ListObject)getCurrentRowObject();
  int lIndex= getListIndex();
  return "<a href=\"details.jsp?index=" + lIndex + "\">" + lObject.getId() + "</a>";
 }


 public String getLink2()
 {
  ListObject lObject= (ListObject)getCurrentRowObject();
  int lId= lObject.getId();

  return "<a href=\"details.jsp?id=" + lId
   + "&action=view\">View</a> | "
   + "<a href=\"details.jsp?id=" + lId
   + "&action=edit\">Edit</a> | "
   + "<a href=\"details.jsp?id=" + lId
   + "&action=delete\">Delete</a>";
 }

鍗併佸垎欏?BR>   瀹炵幇鍒嗛〉闈炲父鐨勭畝鍗曪紝澧炲姞涓涓猵agesize灞炴ф寚瀹氫竴嬈℃兂鏄劇ず鐨勮鏁板嵆鍙?BR><display:table name="sessionScope.test" pagesize="10">
 <display:column property="id" title="ID" />
 <display:column property="name" />
 <display:column property="email" />
 <display:column property="status" />
</display:table>

鍗佷竴銆佹帓搴?BR>   鎺掑簭瀹炵幇涔熸槸寰堢畝鍗曪紝鍦ㄩ渶瑕佹帓搴忕殑column閲屽鍔爏ortable="true"灞炴э紝headerClass="sortable"浠呬粎鏄?BR>   鎸囧畾鏄劇ず鐨勬牱寮忋俢olumn閲岀殑灞炴у璞¤瀹炵幇Comparable鎺ュ彛錛屽鏋滄病鏈夌殑璇濆彲浠ュ簲鐢╠ecorator
   defaultsort="1"              榛樿絎竴涓猚olumn鎺掑簭
   defaultorder="descending"    榛樿閫掑噺鎺掑簭
<display:table name="sessionScope.stest" defaultsort="1" defaultorder="descending">
  <display:column property="id" title="ID" sortable="true" headerClass="sortable" />
  <display:column property="name" sortable="true" headerClass="sortable"/>
  <display:column property="email" />
  <display:column property="status" sortable="true" headerClass="sortable"/>
</display:table>
  娉ㄦ剰鐨勬槸錛屽綋鍚屾椂瀛樺湪鍒嗛〉鏃舵帓搴忎粎浠呴拡瀵圭殑鏄綋鍓嶉〉闈紝鑰屼笉鏄暣涓狶ist閮借繘琛屾帓搴?BR> 
鍗佷簩銆乧olumn 鍒嗙粍
   鍒嗙粍鍙槸闇瑕佸湪column閲屽鍔爂roup灞炴?BR><display:table name="test" class="simple">
  <display:column property="city" title="CITY" group="1"/>
  <display:column property="project" title="PROJECT" group="2"/>
  <display:column property="amount" title="HOURS"/>
  <display:column property="task" title="TASK"/>
</display:table>

鍗佷笁銆佸鍑烘暟鎹埌鍏朵粬鏍煎紡錛堥〉闈㈡孩鍑篺ilter??錛?/STRONG>
   鍦?lt;display:table/>閲岃瀹歟xport="true"
   鍦?lt;display:column/>閲岃瀹歮edia="csv excel xml pdf" 鍐沖畾璇ュ瓧孌靛湪瀵煎嚭鍒板叾浠栨牸寮忔椂琚寘涓嶅寘鍚紝涓嶈瀹氬垯閮藉寘鍚?BR>   <display:setProperty name="export.csv" value="false" />
   鍐沖畾璇ョ鏍煎紡鑳戒笉鑳藉湪欏甸潰涓鍑?BR><display:table name="test" export="true" id="currentRowObject">
  <display:column property="id" title="ID"/>
  <display:column property="email" />
  <display:column property="status" />
  <display:column property="longDescription" media="csv excel xml pdf" title="Not On HTML"/>
  <display:column media="csv excel" title="URL" property="url"/>
  <display:setProperty name="export.pdf" value="true" />
  <display:setProperty name="export.csv" value="false" />
</display:table>

鍗佸洓銆侀厤緗睘鎬э紝瑕嗙洊榛樿
  涓ょ鏂規(guī)硶錛?BR>  A銆佸湪紼嬪簭classpath涓嬫柊寤篸isplaytag.properties鏂囦歡
  B銆佸浜庡崟涓〃鏍鹼紝搴旂敤<display:setProperty>鏍囩
  鍏蜂綋鍙厤緗殑灞炴э細(xì)http://displaytag.sourceforge.net/configuration.html
 
鍗佷簲銆佷竴涓畬鏁寸殑渚嬪瓙
<display:table name="test" export="true" sort="list" pagesize="8">
  <display:column property="city" title="CITY" group="1" sortable="true"    headerClass="sortable"/>
  <display:column property="project" title="PROJECT" group="2" sortable="true" headerClass="sortable"/>
  <display:column property="amount" title="HOURS"/>
  <display:column property="task" title="TASK"/>
</display:table>
   sort="list" 瀵規(guī)暣涓猯ist榪涜鎺掑簭
   瀵煎嚭鏁版嵁鍒板叾浠栨牸寮忔椂錛実roup鏃犳晥



ronghao 2005-12-08 16:10 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 亚洲日韩中文无码久久| www视频在线观看免费| 曰皮全部过程视频免费国产30分钟| 亚洲AV日韩AV永久无码下载| 两个人的视频www免费| 国产亚洲av人片在线观看| 国产精品午夜免费观看网站| 全部免费毛片在线| 人妻无码中文字幕免费视频蜜桃| 国产成人精品123区免费视频| 亚洲精品蜜夜内射| 全部免费国产潢色一级| 四虎成人精品国产永久免费无码 | 一个人看的在线免费视频| 亚洲精品无码专区久久同性男| 一级做a免费视频观看网站| 国产亚洲AV夜间福利香蕉149| 怡红院免费全部视频在线视频| 亚洲第一AAAAA片| 99久久免费国产香蕉麻豆| 99999久久久久久亚洲| 欧洲美熟女乱又伦免费视频| 日本一区二区在线免费观看 | 亚洲第一成年免费网站| 亚洲精品456播放| 久久精品一区二区免费看| 亚洲中字慕日产2020| 国产大片免费观看中文字幕| 91成人免费观看在线观看| 久久av无码专区亚洲av桃花岛| 性色av无码免费一区二区三区| 亚洲欧洲无码一区二区三区| 亚洲欧洲日产国码高潮αv| 暖暖在线视频免费视频| 亚洲人成网站999久久久综合| 国产精品亚洲美女久久久| 91高清免费国产自产拍2021| 亚洲av无码专区首页| 亚洲精品成人片在线观看精品字幕| 最近中文字幕高清免费中文字幕mv| 亚洲性色AV日韩在线观看|