Home Ask Login Register

Developers Planet

Your answer is one click away!

JasSy February 2016

Unable to reference BCrypt File from JSP

I am trying to encrypt my password prior to storing in my remote database but I get an error saying

"Classes from the default package must not be referenced from JSP file"

Where else should I reference it? I am having BCrypt as a jar file in my lib folder.

//Code at JSP file

                //This line causes error
                String hashed = BCrypt.hashpw(password, BCrypt.gensalt());


Aleksey Bykov February 2016

You should put your class to the package.

The JSP page is compiled into a class that is placed in the package. Classes that are in packages, can't import classes that are in the default package.

Post Status

Asked in February 2016
Viewed 1,509 times
Voted 7
Answered 1 times


Leave an answer

Quote of the day: live life