Defaulting Request Header in REST service using spring
Ganesh Kumar C V
Joined: May 12, 2011
Hi - I have a controller which handles all the requests to a set of REST services. For one of the services, I defined the @RequestMapping like the below and its working fine.
@RequestMapping(value = "NetworkOrder/Note",
method = RequestMethod.GET,
The issue is that I need to default the value of this header 'X-YY-Version' to some value if the request does not contain this header set. Also the service should not complaint if the value is not available in the request. Right now I am getting the below exception if the header is not available in the request. Any help will be very useful.