日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

解决Unable to find taglib [cr] for URI: [WBE-INF/tlds/testlib.tld]] with root cause的可能性方案

發布時間:2023/12/20 编程问答 44 豆豆
生活随笔 收集整理的這篇文章主要介紹了 解决Unable to find taglib [cr] for URI: [WBE-INF/tlds/testlib.tld]] with root cause的可能性方案 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
最近在學習自定義JSP標簽,按照網上的例程敲了一下發現出現500錯誤,錯誤信息Unable to find taglib [cr] for URI: [WBE-INF/tlds/testlib.tld]] with root cause

反復檢查了Tomcat/logs中的信息和自己的配置路徑確認沒有問題之后,偶然想到可能是版本不同(網上的例程版本已經比較老了),然后打開Tomcat提供的example文件之后發現果然書寫格式有許多不一樣,接下來直接貼出對比:

存在問題的tld文件定義方法:

<?xml version="1.0" encoding="ISO-8859-1" ?> <!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. --> <!DOCTYPE taglibPUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN""http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd"> <taglib><tlibversion>1.0</tlibversion><jspversion>1.2</jspversion><shortname>challen</shortname><tag><name>cr</name><tagclass>com.challen.jsp.CopyRightTag</tagclass><bodycontent>empty</bodycontent><attribute/></tag> </taglib>修改后可行的代碼:

<?xml version="1.0" encoding="ISO-8859-1" ?> <!--Licensed to the Apache Software Foundation (ASF) under one or morecontributor license agreements. See the NOTICE file distributed withthis work for additional information regarding copyright ownership.The ASF licenses this file to You under the Apache License, Version 2.0(the "License"); you may not use this file except in compliance withthe License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing, softwaredistributed under the License is distributed on an "AS IS" BASIS,WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.See the License for the specific language governing permissions andlimitations under the License. --> <!DOCTYPE taglibPUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN""http://java.sun.com/j2ee/dtd/web-jsptaglibrary_1_2.dtd"> <taglib><tlib-version>1.0</tlib-version><jsp-version>1.2</jsp-version><short-name>challen</short-name><tag><name>cr</name><tag-class>com.challen.jsp.CopyRightTag</tag-class><body-content>empty</body-content><attribute/></tag> </taglib>


正如經常看到的那句話,MVC架構目前還沒有一個成熟的理論或是模式給人們去學習,大家只能通過現有的例程去感受MVC設計思想一樣,在遇到問題的時候,去提供的例程里尋找答案也是不錯的選擇

共勉!






總結

以上是生活随笔為你收集整理的解决Unable to find taglib [cr] for URI: [WBE-INF/tlds/testlib.tld]] with root cause的可能性方案的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。