JSTL taglib URI已经过时了? [英] JSTL taglib URI is obsolete?

查看:573
本文介绍了JSTL taglib URI已经过时了?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在检查Spring MVC教程,并从那里复制了这个小的JSP代码:

 <%@ page会话= 假 %GT; 
<%@ taglib prefix =curi =http://java.sun.com/jsp/jstl/core%>

< html>
< head>< title> Training,Inc.< / title>< / head>
< body>
< h2>< c:out value =$ {message}/>< / h2>
< / body>
< / html>

有一个字符串设置为消息,c:out标签只是打印字面上



$ {message}



我正在打我的头一会儿,直到我记得一个问题之前已将taglib URI更改为:

 <%@ taglib prefix =curi =http:// java.sun.com/jstl/core%> 

这解决了我的小问题



很久以前,我有一个与XSLT转换相似的问题,但在这种情况下,我必须从 http:/ /java.sun.com/jstl/xml http ://java.sun.com/jsp/jstl/xml



根据这个链接我的春天的例子应该像从Spring教程粘贴一样工作



问题是:
你们中的任何人都知道这个taglib URI混淆在哪里记录?为什么在某些情况下,我得到了 http://java.sun.com/jsp/jstl ,其他的我从 http://java.sun.com/jstl

如果你仍然收到这个错误,但是你手工制作你的pom,你可能错过了标准图书馆。
例如我错过了

 <依赖关系> 
< groupId> taglibs< / groupId>
< artifactId> standard< / artifactId>
< version> $ {jstl.version}< / version>
< / dependency>


I've been checking out Spring MVC tutorial and copied this small JSP code from there:

<%@ page session="false"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
    <head><title>Training, Inc.</title></head>
    <body>
        <h2><c:out value="${message}" /></h2>
    </body>
</html>

There is a string set for message and the c:out tag just prints literally

${message}

I was hitting my head for a while until I remembered an issue I had before and changed the taglib URI to:

<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>

This solved my little problem

Some time ago I had a similar issue with XSLT transforming but in that case I had to change from http://java.sun.com/jstl/xml to http://java.sun.com/jsp/jstl/xml

According with this link my spring example should've worked just as I pasted from spring tutorial

The question is: Any of you guys know where is all this taglib URI confusion documented? Why in the some cases I got the last version from http://java.sun.com/jsp/jstl and in other ones I got the last version from http://java.sun.com/jstl

解决方案

If you're still getting this error, but you're hand crafting your pom, you probably have missed the standard library. e.g. I'd missed

    <dependency>
        <groupId>taglibs</groupId>
        <artifactId>standard</artifactId>
        <version>${jstl.version}</version>
    </dependency>

这篇关于JSTL taglib URI已经过时了?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆