June 2018
Intermediate to advanced
408 pages
11h 23m
English
Now, let's create a controller class to map the /home request, as follows:
package com.packt.springhighperformance.ch4.controller;import org.springframework.stereotype.Controller;import org.springframework.web.bind.annotation.RequestMapping;@Controllerpublic class BankController { @RequestMapping(value = "/home") public String home() { return "home"; }}
In the preceding code, @Controller defines a Spring MVC controller that contains request mappings. The @RequestMapping(value = "home") object defines a mapping URL, /home, to a method, home(). So, when the browser hits a /home request, it executes the home() method.
Read now
Unlock full access