posts - 22, comments - 17, trackbacks - 0, articles - 15
            BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理
          ? ec將取得的數(shù)據(jù)存入request中。但是ec的標(biāo)簽ec:table 中的action屬性一般都是定位到當(dāng)前的jsp。再從當(dāng)前的request中取數(shù)據(jù)。如果,action只是定位到自己。ok,導(dǎo)出的xls或pdf只有列名,沒有數(shù)值。
          ? 解決辦法:
          ??????? 1.在頁面的頭中添加
          ?
          ?1?<%
          ?2???Object?obj=request.getAttribute("persons");
          ?3???if(obj!=null){
          ?4????session.setAttribute("persons",(List)obj);
          ?5???}else{
          ?6????List?list=(List)session.getAttribute("persons");
          ?7????request.setAttribute("persons",list);
          ?8???}
          ?9???List?list?=?(List)?request.getAttribute("persons");
          10???//System.out.println(list.getClass().getName());
          11???session.setAttribute("persons",?list);
          12?%>

          ? 較為簡(jiǎn)單,不說了。方法很齷齪。
          ? 2.

          ??? AppTemplate.wc?action=showAttributes

          ??? 將ec:table 的屬性action定位到查詢數(shù)據(jù)的servlet name。就是讓它再查一次。

          ?? 魚與熊掌不可兼得啊!

          ok了 ,enjoy it!


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 且末县| 阳原县| 京山县| 金沙县| 登封市| 山东省| 柯坪县| 林甸县| 青田县| 马关县| 绥芬河市| 贵阳市| 三都| 永泰县| 新泰市| 墨脱县| 宕昌县| 南涧| 定日县| 田东县| 盐池县| 吉木萨尔县| 南通市| 新郑市| 托克逊县| 泗洪县| 汪清县| 石景山区| 睢宁县| 崇文区| 贵州省| 余姚市| 汕尾市| 明溪县| 玛沁县| 大名县| 邳州市| 金堂县| 贡山| 宣化县| 嘉善县|