如何在单个文件

时间:2017-02-06 11:09:32

标签: java

我有一个jsp文件,我需要在其中使用类Base64的方法。 java.util中有一个方法:

java.util.Base64.getEncoder().encodeToString().

并且

中存在另一种方法
    org.apache.commons.codec.binary package :
    org.apache.commons.codec.binary.Base64.encodeBase64String()

所以为了达到这个目的,我使用了完全分类的名字,但仍然是错误的。

  

org.apache.jasper.JasperException:无法为JSP编译类:An   错误发生在jsp文件中的第59行:/ProcessDetails.jsp   org.apache.commons.codec.binary.Base64无法解析为某种类型   56:字符串签名=   。java.util.Base64.getEncoder()encodeToString(sha256_HMAC.doF伊纳勒(data.getBytes()));   59:String paymentToken =   org.apache.commons.codec.binary.Base64.encodeBase64String(SH a256_HMAC.doFinal(DA ta.getBytes()));

1 个答案:

答案 0 :(得分:0)

听起来您可能缺少WEB-INF / lib中的apache commons jar 见jsp "unable to compile" and "cannot be resolved to a type"

或者JSP中缺少import语句 见Unable to compile class for JSP: cannot be resolved to a type

希望有所帮助

相关问题