This is my Java code in a JSP file. I am getting
Base64Encoder cannot be resolved.
Why is it so? I have to add something relat
Looks like you are using a class that does not exist in a jar you have included in the web application. Can you try the following? Make adjustments if necessary, I am just looking at the documentation for commons and typing this out --
with
String encoding = new String(
org.apache.commons.codec.binary.Base64.encodeBase64
(org.apache.commons.codec.binary.StringUtils.getBytesUtf8("test:test"))
);
I suspect you're not using a standalone JRE instead of the one included in the JDK.
The class should now resolve.
You may need to do an import or specify the fully qualified class name for Base64Encoder
I don't see an inclusion of the namespace here for Base64Encoder. Try adding 'com.oreilly.servlet' to your import.