当前位置:编程学习 > JAVA >>

自定义标签uri找不到


<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/tld/helloworld" prefix="mytag"%><!-- 在页面中加以声明 -->  
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">  
<html>  
  <head>  
   <title>MyJSP</title>      
  </head>    
  <body>  
    <mytag:helloworld></mytag:helloworld>  
  </body>  
  </html>  

<?xml version="1.0" encoding="UTF-8"?>  
<web-app version="2.5"   
    xmlns="http://java.sun.com/xml/ns/javaee"   
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   
    xsi:schemaLocation="http://java.sun.com/xml/ns/javaee   
    http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">    
     <jsp-config>
        <taglib>
           <taglib-uri>/tld/helloworld</taglib-uri>
           <taglib-location>/WEB-INF/tlds/helloworld.tld</taglib-location>
        </taglib>
     </jsp-config>
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
</web-app>

<?xml version="1.0" encoding="UTF-8"?>  
<!DOCTYPE taglib PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"  
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd">     
<taglib>  
   <tlib-version>1.0</tlib-version><!-- 标签库的版本 -->  
   <jsp-version>1.2</jsp-version><!-- 这个标签库要求的JSP规范版本 -->  
   <short-name>mytag</short-name><!-- JSP页面编写工具可以用来创建助记名的可选名字 -->  
   <tag>  
      <name>helloworld</name><!-- 唯一标签名 -->  
      <tag-class>com.yd.mytag.HelloWorldTag</tag-class><!-- 标签HelloWorldTag类的完全限定名 -->  
      <body-content>empty</body-content><!-- 正文内容类型 -->  
   </tag>  
</taglib>  

--------------------编程问答-------------------- 看这配置,好像没问题。
http://www.iteye.com/topic/198633
补充:Java ,  Web 开发
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,