method = POST
will work if you ‘post’ a form to the url /test.
if you type a url in address bar of a browser and hit enter, it’s always a GET
request, so you had to specify POST request.
Google for HTTP GET
and HTTP POST
(there are several others like PUT DELETE). They all have their own meaning.
More Related Contents:
- How to solve the “failed to lazily initialize a collection of role” Hibernate exception
- How to respond with HTTP 400 error in a Spring MVC @ResponseBody method returning String?
- Passing multiple variables in @RequestBody to a Spring MVC controller using Ajax
- Spring MVC – How to get all request params in a map in Spring controller?
- How to serve .html files with Spring
- Multipart File Upload Using Spring Rest Template + Spring Web MVC
- Spring MVC – How to return simple String as JSON in Rest Controller
- How to manage REST API versioning with spring?
- Disable Spring Security for OPTIONS Http Method
- How to bind an object list with thymeleaf?
- How to set base url for rest in spring boot?
- @Valid annotation is not validating the list of child objects
- HttpSecurity, WebSecurity and AuthenticationManagerBuilder
- Unable to complete the scan for annotations for web application [/app] due to a StackOverflowError
- Spring security does not allow CSS or JS resources to be loaded
- how to display custom error message in jsp for spring security auth exception
- spring mvc not returning json content – error 406
- Spring Boot Actuator without Spring Boot
- What is username and password when starting Spring Boot with Tomcat?
- Spring 4 + Hibernate 5 = org.springframework.orm.jpa.EntityManagerHolder cannot be cast to org.springframework.orm.hibernate5.SessionHolder
- getServletConfigClasses() vs getRootConfigClasses() when extending AbstractAnnotationConfigDispatcherServletInitializer
- Spring Security HTTP Basic for RESTFul and FormLogin (Cookies) for web – Annotations
- Spring security added prefix “ROLE_” to all roles name?
- Why this Spring application with java-based configuration don’t work properly
- Return a stream with Spring MVC’s ResponseEntity
- What are annotations and how do they actually work for frameworks like Spring?
- How I create an error handler (404, 500…) in Spring Boot/MVC
- Spring-MVC 406 Not Acceptable instead of JSON Response
- java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet error
- Spring MVC: How to modify json response sent from controller