一级目录
@Controller
public class ControllerTest {
@RequestMapping("/t1")
public String test1(Model model){
model.addAttribute("msg","Controller");
return "test";
}
}
2.二级目录
@Controller
@RequestMapping("/c3")
public class RequestTest {
@RequestMapping("/t1")
public String testString(Model model){
model.addAttribute("msg","requestMapping...");
return "test";
}
}
或者使用下面的方式:
@Controller
public class RequestTest {
@RequestMapping("/c3/t1")
public String testString(Model model){
model.addAttribute("msg","requestMapping...");
return "test";
}
}