JSP 无法解析 org.apache.commons.lang 的导入
我正在尝试包含 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在 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.