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

    <html>
        <body>
            <%
                //This line causes error
                String hashed = BCrypt.hashpw(password, BCrypt.gensalt());
            %>
        </body>
    </html>

Answers


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

Search




Leave an answer