首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > JAVA > Java Web开发 >

刚学jsp,问一下标志库的有关问题

2011-11-29 
刚学jsp,问一下标志库的问题。%@taglibprefix c uri http://java.sun.com/jsp/jstl/core %htmlc

刚学jsp,问一下标志库的问题。
<%@   taglib   prefix= "c "   uri= "http://java.sun.com/jsp/jstl/core "   %>
<html>
  <c:choose>
        <c:when   test= "${param.portchoice   ==   'news '} ">
            <head> <title> News   Portal </title> </head>
            <body>
              <h1> Welcome   to   the   News   Portal! </h1>      
            </body>
        </c:when>
        <c:when   test= "${param.portchoice   ==   'weather '} ">
              <head> <title> Weather   Portal </title> </head>
              <body>
                <h1> You   Get   the   Latest   Weather! </h1>      
              </body>
        </c:when>
        <c:when   test= "${param.portchoice   ==   'entertainment '} ">
              <head> <title> Entertainment   Portal </title> </head>
              <body>
              <h1> Entertainment   News   Just   for   You! </h1>      
              </body>
        </c:when>
        <c:otherwise>
              <head> <title> System   Portal </title> </head>
              <body>
              <h1> Application   logic   problem   detected! </h1>      
              </body>
        </c:otherwise>
</c:choose>
</html> 上面的代码使用了标志库,请问uri= "http://java.sun.com/jsp/jstl/core "是什么意思,是不是可以随便乱写的,还是有什么规定的?

[解决办法]
需要和web.xml里声明的uri一样
[解决办法]
<%@ taglib prefix= "c " uri= "http://java.sun.com/jsp/jstl/core " %>
这个是表示加载JSP 2.0的标准标签库中的核心标签库,里面的prefix值可以改,但是不推荐,后面uri里的写法是固定的.
标准标签库中还有其他的标签
<%@ taglib prefix= "sql " uri= "http://java.sun.com/jsp/jstl/sql " %>
导入标准标签库的SQL标签库.
<%@ taglib prefix= "fmt " uri= "http://java.sun.com/jsp/jstl/fmt " %>
国际标准化库
.........

热点排行