Say I have this:
@RequestMapping(value="/hello")
public ModelAndView hello(Model model){
System.out.println("HelloWorldAction.sayHello");
return null;
}
Is it possible to skip the value = "hello" part and just have the @RequestMapping annotation and have the spring method name as a value, similar to this:
@RequestMapping
public ModelAndView hello(Model model){
System.out.println("HelloWorldAction.sayHello");
return null;
}
Thank!
==================== EDIT ======================
Tried this but didn't work:
@Controller
@RequestMapping(value="admin", method=RequestMethod.GET)
public class AdminController {
@RequestMapping
public ResponseEntity<String> hello() {
System.out.println("hellooooooo");
}
}
source
share