-2

I'm trying to develop a new java web application from scratch. I'm using the IntelliJ IDE, and maven build tool.

  • Why servlets can be created only under the resources folder ?
  • Why jsp filels can be created only under the webapp folder?

Thanks

AlvaroAV
  • 10,335
  • 12
  • 60
  • 91

2 Answers2

0

Sounds like you need to do some research into how Maven is building your project.

You should create servlets under src/main/java folder.

Run the maven build and then explore the generated WAR file, this way you can get an idea of how Maven is structuring the project.

You should see the that the webapp folder is in fact simply deployed at the root of the WAR file, hence your JSPs are placed in the correct location.

cowls
  • 24,013
  • 8
  • 48
  • 78
0

Thanks everybody, but i resolved the issue myself.

The Solution:

  1. Go to the folder which you want to make available for java classes or servlets, and right click it.
  2. Choose: Mark directory as...
  3. Choose: Sources Root