Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WEB-INF folder is not creating in Spring Boot application?

I am creating a Spring Boot application, using Spring Initializr, But the folder structure is bit different, there is no WEB-INF folder, so where I will put the JSP files, shall I create the WEB-INF folder manually?

like image 318
Rajanikanta Pradhan Avatar asked Jan 16 '18 09:01

Rajanikanta Pradhan


3 Answers

We need to crate WEB-INF folder manually in spring boot application. Follow below steps to create WEB-INF folder

  1. Select main folder as highlighted below.

    enter image description here

  2. Right click and create a folder with name webapp.
  3. Now right click on webapp folder and create WEB-INF folder.
  4. Now similarly create a view folder (or any other name you like) inside WEB-INF folder to keep all the JSPs.
  5. Below should be the folder structure after doing above steps.

    enter image description here

like image 147
sapan prajapati Avatar answered Nov 09 '22 19:11

sapan prajapati


Usually the web files will go into the resources folder with spring boot. https://spring.io/guides/gs/serving-web-content/

like image 44
craigwor Avatar answered Nov 09 '22 19:11

craigwor


Dumping the jsp files in src/main/webapp folder worked for me, both with or without WEB-INF. I followed the exact project structure mentioned in

  1. mkyong.com
  2. springboottutorial
like image 3
arc Avatar answered Nov 09 '22 20:11

arc