I am calling a REST URL that returns a 404 if data cannot be found, along with a body that contains some XML. A 404 is a valid case and an exception should not be thrown. (I am using Spring 3.0.5.)
I am calling RestTemplate.getForObject() and want it to return null if the REST call results in a 404.
How can I configure the RestTemplate to return null when a 404 happens?Code:Foo foo = restTemplate.getForObject(url, Foo.class, vars);