JAVA-JSP之taglib指令

相关资料:
《21天学通Java Web开发》
http://blog.csdn.net/dyyaries/article/details/9960987

备注:
这个实例我没有跑起来,我看的是另一个网页上的资料。

结果总结:
1.taglib指令用来声明此JSP文件使用了自定义标签,同时引用所指定的标签库并设置标签库的前缀。
2.<%@ taglib uri="URIToTagLibrary" prefix="tagprefix"%>
3.taglib指令包含两个属性,分别为uri和prefix。
4.uri属性用来指定标签库的存放位置
5.prefix属性用来指定该标签库使用的前缀。

实例代码:

 1 <%@ page contentType="text/html; charset=GB2312" %>
 2 <%-- 声明页面中将要引用的标签库--%>
 3 <%@ tablib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
 4 <html>
 5 <head>
 6   <title>taglib指令使用示例</title>
 7 </head>
 8 <body>
 9   <%-- 使用JSTL标签输出字符串 --%>
10   <c:out value="Hello, World!" />
11 </body>
12 </html>
View Code

 

posted on 2017-08-30 16:23  疯狂delphi  阅读(1571)  评论(0编辑  收藏  举报

导航