I’m trying to use a class I defined in a package in my Java Web Project, however I keep getting errors when I use the class I defined in the package. The error is saying that the class cannot be resolved to a type. I am importing the package that I made that contains the class that I want to use.
Share
The class needs to be located in webapp’s
/WEB-INF/classesin a folder structure which represents the declaredpackage. So if you have for examplethen you should have a
/WEB-INF/classes/com/example/Foo.classfile. Please keep in mind that this is case sensitive as everything else in Java.Another possible cause is when you’re trying to use it in a
<jsp:useBean>tag, that it should have a (implicit) default constructor which doesn’t throw an exception upon construction.