Home > Net >  The import cannot be resolved in JSP
The import cannot be resolved in JSP

Time:10-27

Before posting this message I read tens of threads but with no success. I am trying to import a package into one of my JSP files and I keep getting the same error:

The import cannot be resolved.

I believe that something is not right with my project structure. I have tried everything, from cleanup, rebuild, even creating another project from scratch.

This is the structure of my project:

Project structure

And these are the contents of my build path:

Build path 1

Libraries build path

I would greatly appreciate any kind of help, this is a big blocker right now for me.

CodePudding user response:

Yes, it's your project structure. Your source files are not actually under the src folder that would be listed on the Source tab of the Java Build Path property page you're showing (you can see how it's laid out that folder's contents to resemble package names). Either move the files to where they're expected or update the Source tab to point to where you're actually keeping them.

CodePudding user response:

add the Java Resources/src folder to the build path or the library build path.

CodePudding user response:

Thanks a lot for your answers, I have changed the project structure like in the image below and now it works:

enter image description here

  • Related