1

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?

skaffman
  • 398,947
  • 96
  • 818
  • 769
mobibob
  • 8,670
  • 20
  • 82
  • 131
  • This is not a URL. It's a path. Are you using an IDE? a servlet container? which? Where's the jar file? what is the classpath? – Yuval F Feb 28 '10 at 19:02
  • Hi Yuval F, Sorry for the terminology confusion. Brabster got me going with my other related question. As for your question, I am using Eclipse and as I added the statement, Eclipse was 'keeping up' with my import statement until I added '.lang', at which point it red-lined my path. I have switched over to using java.net.URLEncoder per the other question. – mobibob Feb 28 '10 at 19:39

1 Answers1

2

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.

Community
  • 1
  • 1
brabster
  • 42,504
  • 27
  • 146
  • 186