Catalyst
Catalyst

Reputation: 465

Add web.xml in Spring Maven project

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.

Upvotes: 2

Views: 7415

Answers (3)

Petar
Petar

Reputation: 331

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.

Upvotes: 0

Alok Sharma
Alok Sharma

Reputation: 303

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.

Upvotes: 1

Leviand
Leviand

Reputation: 2805

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

Upvotes: 5

Related Questions