Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Boot + WEB-INF

I have a very simple spring boot project with dependency

<dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-web</artifactId>
    <exclusions>
        <exclusion>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-tomcat</artifactId>
        </exclusion>
    </exclusions>
</dependency>

When I build this , web-inf folder gets created in target directory, and packages everything in classes, and lib folder.

I want to have one xml file ("jboss-deployment-structure.xml") at the root of the web-inf, ("web-inf/jboss-deployment-structure.xml") where should I put it in the src folder?

I tried creating "public/jboss-deployment-structure.xml" folder in src, but no luck.

like image 982
Mayurb Avatar asked Jan 16 '15 19:01

Mayurb


People also ask

What is WEB-INF folder in spring boot?

WEB-INF. This directory, which is contained within the Document Root, is invisible from the web container. It contains all resources needed to run the application, from Java classes, to JAR files and libraries, to other supporting files that the developer does not want a web user to access.

What is WEB-INF?

The WEB-INF directory contains the deployment descriptors for the Web application (web. xml and weblogic. xml) and two subdirectories for storing compiled Java classes and library JAR files. These subdirectories are respectively named classes and lib.

Can I use jsp in spring boot?

When building Web Applications, JavaServer Pages (JSP) is one option we can use as a templating mechanism for our HTML pages. On the other hand, Spring Boot is a popular framework we can use to bootstrap our Web Application.


1 Answers

Maybe a little bit late, but in order to put your xml file inside WEB-INF, if you are using Maven, the correct placement will be:

src/main/webapp/WEB-INF/jboss-deployment-structure.xml
like image 108
J. Molinero Avatar answered Oct 11 '22 20:10

J. Molinero