Explain @RequestMapping annotation.

Solution

@RequestMapping annotation is used to map a URL to either an entire class or a particular method.

The @RequestMapping annotation uses the value attribute to map the method to a path. The method attribute is used to indicate the HTTP request type (example: GET, POST, DELETE).

For example:

@RequestMapping(value="/login", method=RequestMethod.GET)
public String login(){
    //Insert code here 
}

Share this thread

Comments

Comments
comments powered by Disqus

Navigation

Social Media