| Author |
What is the difference between using @RequestMapping before class and before method
|
Abhra Kar
Ranch Hand
Joined: May 22, 2008
Posts: 114
|
|
What is the difference between these two---
@Controller
public class HomeController {
@RequestMapping("/home")
public ModelAndView handleRequest( HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
......................................................................................................
......................................................................................................
}
}
and
@Controller
@RequestMapping("/home.htm")
public class HomeController {
public ModelAndView handleRequest( HttpServletRequest request,
HttpServletResponse response) throws ServletException, IOException {
......................................................................................................
......................................................................................................
}
}
If we want to call a controller against home.html(properly defined in dispatcher-servlet.xml) can we use any one of this interchangeably
waiting for reply
please help
thanks in advance
|
 |
Boris Romashov
Ranch Hand
Joined: Feb 23, 2009
Posts: 38
|
|
|
@RequestMapping on class makes that URL to be base for all @RequestMapping on methods.
|
 |
Abhra Kar
Ranch Hand
Joined: May 22, 2008
Posts: 114
|
|
|
Thanks a lot for the help
|
 |
 |
|
|
subject: What is the difference between using @RequestMapping before class and before method
|
|
|