隨筆-13  評論-6  文章-0  trackbacks-0
          使用MyEclipse開發web項目,所生成的web.xml頭部如下:
          <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

          等到要在web.xml加入taglib
              <taglib>
                  <taglib-uri>/WEB-INF/tiles.tld</taglib-uri>
                  <taglib-location>/WEB-INF/tiles.tld</taglib-location>
              </taglib>
          始終會報錯
          后來把頭部改為
          <?xml version="1.0" encoding="UTF-8"?>
          <!DOCTYPE web-app
            PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
            "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">

          <web-app>
          ......
          </web-app>
          終于可以加taglib了,但原來的filter又報錯,最后把
          filter和filter-mapping放在最前面,終于ok.

          posted on 2006-03-14 16:02 java之海 閱讀(5012) 評論(6)  編輯  收藏 所屬分類: struts

          評論:
          # re: web.xml加入taglib報錯 2006-11-22 14:20 | yubaojian0616
          2.3當然支持 你這相當于沒改么  回復  更多評論
            
          # re: web.xml加入taglib報錯 2007-02-25 10:51 | Messi
          對于2.4的web-app,taglib標簽的放置位置已經發生改變,要放在<jsp-config>標簽下 <jsp-config> <taglib> <taglib-uri>/WEB-INF/tld/struts-layout.tld</taglib-uri> <taglib-location>/WEB-INF/tld/struts-layout.tld</taglib-location> </taglib></jsp-config>

          廣交技術好友,加我qq:381760190  回復  更多評論
            
          # re: web.xml加入taglib報錯 2008-08-06 11:08 | 韓振超
          <filter>
          <init-param>
          <description>Encoding</description>
          <param-name>encoding</param-name>
          <param-value>gb2312</param-value>
          </init-param>
          </filter>
          在改完web.xml的名頭后,上面的代碼報錯.后來改成:
          <filter>
          <init-param>
          <param-name>encoding</param-name>
          <param-value>gb2312</param-value>
          <description>Encoding</description>
          </init-param>
          </filter>
          就正確了,感覺應該是web.xml不同的頭部對參數位置的要求不一樣吧.
            回復  更多評論
            
          # re: web.xml加入taglib報錯 2009-10-26 15:08 | xxxxxx
          正解  回復  更多評論
            
          # re: web.xml加入taglib報錯 2009-10-26 15:09 | xxxxxx
          Messi 正解  回復  更多評論
            
          # re: web.xml加入taglib報錯 2009-12-10 13:16 | 收拾收拾
          我我我  回復  更多評論
            
          主站蜘蛛池模板: 诸暨市| 曲阜市| 吉木萨尔县| 杭州市| 富裕县| 大关县| 舒城县| 元阳县| 渑池县| 兴海县| 托克逊县| 襄汾县| 葫芦岛市| 广安市| 梧州市| 西充县| 恩平市| 平乐县| 灵川县| 海阳市| 虹口区| 岢岚县| 武山县| 得荣县| 柘荣县| 鄯善县| 富顺县| 安新县| 娄底市| 正定县| 攀枝花市| 崇义县| 九龙坡区| 绥芬河市| 彝良县| 康马县| 敦煌市| 固原市| 都安| 壶关县| 滨海县|