2

In a Spring 'Maven' project, where to place web.xml file?

I am creating a spring mvc project and not sure about where to put web.xml in the project.

Catalyst
  • 465
  • 6
  • 14

3 Answers3

5

This is an example of a structure of Spring project with maven

├── src
│   └── main
│       ├── java
│       │   └── com
│       │       └── hellokoding
│       │           └── hello
│       │               └── web
│       │                   └── YourClass.java
│       ├── resources
│       │   ├── application.properties
│       │   └── logback.xml
│       └── webapp
│           ├── resources
│           │   ├── css
│           │   │   └── bootstrap.min.css
│           │   ├── images
│           │   └── js
│           │       └── bootstrap.min.js
│           └── WEB-INF
│               ├── views
│               │   └── hello.jsp
|               ├── appconfig-mvc.xml
│               ├── appconfig-root.xml 
│               └── web.xml 
└── pom.xml

From here

Leviand
  • 2,745
  • 4
  • 29
  • 43
1

it's WEB-INF/web.xml Check out the below link ref: https://docs.oracle.com/javaee/5/tutorial/doc/bnadx.html No matter how your archetype structures the project, the final build always follow the specifications. I know the frameworks like spring hides all the specification details and nowadays newbies don't pay attention to all such details. Well knowing specifications and how the frameworks are constructed over these specifications adds value to your software development skills.

Alok Sharma
  • 183
  • 1
  • 12
0

web.xml file is always inside WEB-INF folder, by default Maven is expecting it in there and its the first location that is being searched for a web.xml file.

Petar
  • 273
  • 1
  • 4
  • 16