Spring Web サービスを呼び出そうとしています。ブラウザーで以下の URL を使用すると、サービス「myservice」は XML を返す必要があります。つまり、@RequestMapping アノテーションに基づいて、以下の URL は正しいですか?
> http://localhost:8080/mywebapp/myservice/feeds/allFeeds.xml/
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping("myservice")
public class TheController {
private TheService TheServiceWS;
public TheController(TheService TheServiceWS) {
this.TheServiceWS = TheServiceWS;
}
@RequestMapping(value = "feeds/allFeeds.xml", produces = MediaType.APPLICATION_XML_VALUE)
@ResponseBody
public String getValues() {
return TheServiceWS.getAllFeeds();
}
}