「Spring入門」 @RequestMappingのproducesを指定するサンプル
Javaコード
@RequestMapping(value = “/testAA", produces = “application/xml")
public String testAA() {
return " <info><title>11</title><score>22</score></info>";
}
@RequestMapping(value = “/testBB", produces = MediaType.APPLICATION_XML_VALUE)
public String testBB() {
return " <info><title>11</title><score>22</score></info>";
}