Example 1

In the following example, there is only one RequestMapping in the showPage method. The showPage method will be mapped to GET, POST, and any other request types for URI /show-page:

    @Controller     public class UserController {       @RequestMapping(value = "/show-page")       public String showPage() {         /* Some code */        }     }

Get Mastering Spring 5.0 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.