eclipse jsp 函数 fn:escapeXml 未定义

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12028132/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 18:49:33  来源:igfitidea点击:

eclipse jsp the function fn:escapeXml is undefined

eclipsejsptaglib

提问by MrGibbage

I am beginning my first google app engine jsp project. I am following the tutorial for the guestbook from here: https://developers.google.com/appengine/docs/java/gettingstarted/introduction. I am on the datastore step ( https://developers.google.com/appengine/docs/java/gettingstarted/usingdatastore) and have pasted in the code on that page directly into my project. The code compiles and works, but I get the red squiggly underlines under fn:escapeXml calls. I see that these are functions from a taglib, as explained here: http://www.tutorialspoint.com/jsp/jsp_standard_tag_library.htm. So, how do I make eclipse know what is going on and not think this is an error?

我正在开始我的第一个谷歌应用引擎 jsp 项目。我正在关注这里的留言簿教程:https: //developers.google.com/appengine/docs/java/gettingstarted/introduction。我在数据存储步骤 ( https://developers.google.com/appengine/docs/java/gettingstarted/usingdatastore) 并已将该页面上的代码直接粘贴到我的项目中。代码编译并运行,但我在 fn:escapeXml 调用下得到红色波浪线下划线。我看到这些是来自 taglib 的函数,如下所述:http: //www.tutorialspoint.com/jsp/jsp_standard_tag_library.htm。那么,我如何让 eclipse 知道发生了什么而不认为这是一个错误?

采纳答案by adatapost

You have to include JSTL-1.2.jarin build pathof your application project.

您必须在应用程序项目的构建路径中包含JSTL-1.2.jar

回答by ramit girdhar

I also had the same issues.

我也有同样的问题。

I have included JSTL-1.2.jar file as recomended above and have also included the following line in .jsp file

我已经包含了上面推荐的 JSTL-1.2.jar 文件,并且还在 .jsp 文件中包含了以下行

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>

and ran clean project

并运行干净的项目

this fixed the error

这修复了错误

回答by yellavon

In order to compile jsp you need a JDK installed in your system. If you are running on a JRE you will get this error. If you don't have a JDK, download the 32 or 64 bit version depending on your version of Eclipse. Then in Eclipse, go to: Window->Preferences->Java->Installed JREs and check to see if you have an entry for the path from the previous step. If not, then Click add->Standard VM, then for the JRE Path enter the path from the previous step. You should see all of the JARs added to the library section. Make sure the previous JRE is unchecked, apply, and clean your project.

为了编译jsp,你需要在你的系统中安装一个JDK。如果您在 JRE 上运行,您将收到此错误。如果您没有 JDK,请根据您的 Eclipse 版本下载 32 位或 64 位版本。然后在 Eclipse 中,转到:Window->Preferences->Java->Installed JREs 并检查您是否有上一步中的路径条目。如果没有,则单击添加->标准虚拟机,然后为 JRE 路径输入上一步中的路径。您应该会看到添加到 library 部分的所有 JAR。确保取消选中之前的 JRE,应用并清理您的项目。

回答by Becky reamy

I had the same issue, and it was a duplicated taglib entry for the jstl functions.

我遇到了同样的问题,它是 jstl 函数的重复 taglib 条目。