Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default request method type for the request mapping?

What is the default request method type for the @RequestMapping?

@RequestMapping(value = "addGoal") public String addGoal(Model model) {...} 
like image 362
rozerro Avatar asked Aug 07 '16 06:08

rozerro


People also ask

What is default method in request mapping?

What is the default request mapping method? If we simply don't specify any request path value in the @RequestMapping annotation of a Controller's method, that method is designated as the default request mapping method for that class.

Which of these methods is default method for @RequestMapping annotation?

@RequestMapping — the HTTP Method. The HTTP method parameter has no default. So, if we don't specify a value, it's going to map to any HTTP request.

What is the @RequestMapping annotation used for?

RequestMapping annotation is used to map web requests onto specific handler classes and/or handler methods. @RequestMapping can be applied to the controller class as well as methods.

What is @RequestMapping method Requestmethod post?

The @RequestMapping annotation can be applied to class-level and/or method-level in a controller. The class-level annotation maps a specific request path or pattern onto a controller. You can then apply additional method-level annotations to make mappings more specific to handler methods.


1 Answers

If you do not specify any mapping this method will resolve all the http request i.e. you can send GET, POST, HEAD, OPTIONS, PUT, PATCH, DELETE, TRACE request to the specified url and it will be resolved.

like image 143
codersingh Avatar answered Sep 20 '22 00:09

codersingh