First of all, the convention is to start class names with an uppercase letter: Info
and not info
.
To be able to import a class, it must be in a package. It's a very bad practice to put classes in the default package. And Maven expects Java source files to be in src/main/java
, not in src/main/resources
(which is used for resources like properties files, XML files, etc., loaded from the classpath). So, create a folder tree under src/main/java
(like com/mycompany/myproject
), and put your Java file there. It should start with the following line:
package com.mycompany.myproject;
Then you can import this class as any other class.
But JSPs shouldn't have to import classes anyway. They should only use the JSP EL, the JSTL and other custom tags. No Java code in JSPs.
It looks like you don't master the basics of Java development yet. Start by learning them with simple, console programs before trying to develop a webapp, which is quite a complex task.