Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

difference between /** and /* in Spring

probably it's a very stupid question, but I couldn't find anything on the internet.

What the difference between writing <mvc:mapping path="/**"/> and <mvc:mapping path="/*"/> in Spring?

like image 663
MDP Avatar asked Oct 20 '14 10:10

MDP


People also ask

What is difference between Antmatchers and Mvcmatchers?

antMatcher(String antPattern) - Allows configuring the HttpSecurity to only be invoked when matching the provided ant pattern. mvcMatcher(String mvcPattern) - Allows configuring the HttpSecurity to only be invoked when matching the provided Spring MVC pattern.

What is difference between MVC and Spring MVC?

The MVC term signifies that it follows the Model View Controller design pattern. So, Spring MVC is an integrated version of the Spring framework and Model View Controller. It has all the basic features of the core Spring framework like Dependency Injection and Inversion of Control.

What is the difference between spring Spring MVC and Spring boot?

Spring Boot is considered a module of the Spring framework for packaging the Spring-based application with sensible defaults. Spring MVC is considered to be the model view controller-based web framework under the Spring framework. For building a Spring-powered framework, default configurations are provided by it.

What is difference between spring boot and Spring framework?

In the Spring framework, you have to build configurations manually. In Spring Boot there are default configurations that allow faster bootstrapping. Spring Framework requires a number of dependencies to create a web app. Spring Boot, on the other hand, can get an application working with just one dependency.


1 Answers

It is documented here:

  • http://docs.spring.io/spring/docs/current/spring-framework-reference/html/mvc.html#mvc-ann-requestmapping-pattern-comparison

Basically the Spring supports "Ant style globbing". Thus path="/*" matches any URL in the "/" directory1, and path="/**" matches any URL in the entire directory tree.

The document primarily talks about request mappings specified using annotations, but wirings specified using XML have the same meaning.


1 - I am using the term "directory" loosely here. Strictly speaking these are not directories at all. But you know what I mean ...

like image 74
Stephen C Avatar answered Sep 30 '22 05:09

Stephen C