在将密码存储到远程数据库之前,我试图对密码进行加密,但我收到一个错误信息:
“不能从JSP文件引用默认包中的类”
我还应该在哪里做参考呢?我在我的lib文件夹中将BCrypt作为jar文件。
//Code at JSP file
<html>
<body>
<%
//This line causes error
String hashed = BCrypt.hashpw(password, BCrypt.gensalt());
%>
</body>
</html>发布于 2016-02-09 18:55:24
你应该把你的课放到包里去。
JSP页面被编译成一个放在包中的类。包中的类,无法导入默认包中的类。
https://stackoverflow.com/questions/35278449
复制相似问题