Google News
logo
Java Spring MVC - Interview Questions
How to map controller class and its methods with URL?
The @RequestMapping annotation is used to map the controller class and its methods. You can specify this annotation on the class name as well as method name with a particular URL that represents the path of the requested page. For example :
 
@Controller   
@RequestMapping("/ form")  
  class Demo  
  {  
    @RequestMapping("/show")  
     public String display()  
     {  
  
     }  
 }

 

Advertisement