0

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.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Elvis
  • 25
  • 5
  • https://stackoverflow.com/questions/38340291/jsp-what-is-wrong-with-scriptlets-and-what-to-use-instead, and if you are learning on your own, don't deal with obsolete low-level operations at all; use something like Spring MVC with Boot that automatically handles all of it for you (and Thymeleaf is better than JSP). – chrylis -cautiouslyoptimistic- Oct 18 '21 at 05:10

3 Answers3

1

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.

nitind
  • 19,089
  • 4
  • 34
  • 43
0

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

James E
  • 186
  • 9
0

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

Elvis
  • 25
  • 5
  • Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Oct 19 '21 at 09:08