隨筆-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 | 收拾收拾
          我我我  回復  更多評論
            
          主站蜘蛛池模板: 闽清县| 河津市| 保山市| 星座| 磴口县| 昌吉市| 珲春市| 札达县| 玛纳斯县| 乌拉特中旗| 克什克腾旗| 宝山区| 铜鼓县| 惠来县| 偃师市| 广水市| 常德市| 安义县| 晋江市| 望江县| 涿州市| 额敏县| 耒阳市| 峡江县| 民和| 大埔区| 平舆县| 双鸭山市| 疏附县| 宝应县| 韶山市| 富蕴县| 霸州市| 南丰县| 苍山县| 绥江县| 普格县| 师宗县| 洛隆县| 体育| 额敏县|