JSP 无法解析 org.apache.commons.lang 的导入

发布于 2024-08-24 01:11:36 字数 335 浏览 10 评论 0原文

我正在尝试包含 StringEscapeUtils 库,我能找到的所有内容都表明我可以导入 Apache Org 页面,如下所示:

<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>

但是,我只能将 URL 解析为:

<%@ page import="org.apache.commons.*" %>

当我这样做时,编译仍然无法解析 <代码>StringEscapeUtils。

我做错了什么?

I am trying to include the library StringEscapeUtils and everything that I can find indicates that I can import the Apache Org page as follows:

<%@ page import="org.apache.commons.lang.StringEscapeUtils" %>

however, I can only resolve the URL down to this:

<%@ page import="org.apache.commons.*" %>

and when I do that, the compile still cannot resolve StringEscapeUtils.

What am I doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

病女 2024-08-31 01:11:36

在 Java 中,导入不是对 URL 的引用,而是对 Java 包的引用。要导入该类,您需要在类路径中包含 commons-lang JAR。

如果这与 您之前的问题相关,正如我在那里解释的那样,您似乎不需要外部库。

In Java, imports are not references to URLs, they are references to Java packages. To import that class, you will need to include the commons-lang JAR in your classpath.

If this is related to your earlier question, you do not appear to need an external library, as I explained there.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文