jsp标签取代了JSP中的Java程序,并且可以重复使用,方便不熟悉Java编程的网页设计人员。
首先在eclipse下新建一个动态web工程
1,在</web-app>之前加入
<jsp-config>
<taglib>
<taglib-uri>/tld/helloworld</taglib-uri>
<taglib-location>/WEB-INF/tlds/helloworld.tld</taglib-location>
</taglib>
</jsp-config>
2.在WEB-INF下新建tlds目录,在tlds下新建helloworld.tld.helloworld.tld的内容为
<?xml version="1.0" encoding="ISO-8859-1"?>
<!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>
<short-name>mytag</short-name>
<tag>
<name>helloworld</name>