Spring MVC - @RequestMapping

Exemple @RequestMapping



Class
Method
Description

@RequestMapping
(value="/order.htm")
Maps to all requests on the order.htm
URL.
@RequestMapping
("/order.htm")
@RequestMapping
(method=RequestMethod.GET)
Maps to all GET requests to the order.html URL.
@RequestMapping
("/order.*")


@RequestMapping
(method={RequestMethod.PUT,
RequestMethod.POST})
Maps to all PUT and POST requests to the order.* URL. * means any suffix
or extension such as .htm, .doc, .xls, and so on.
@RequestMapping
(value="/customer.htm",
consumes="application/json")

@RequestMapping
(produces="application/xml")
Maps to all requests that post JSON and accept XML as a response.

@RequestMapping
(value="/order.htm")


@RequestMapping
(params="add-line",
method=RequestMethod.POST)
Maps to all POST requests to the order.htm URL that include an addline parameter.
@RequestMapping
(value="/order.htm")

@RequestMapping
(headers="!VIA")
Maps to all requests to the order.htm URL that don’t include a VIA HTTP
Header.


Aucun commentaire:

Enregistrer un commentaire