Martin Kalin의 "Web Services Up and running" 장 4 장을 작업 중입니다. (비록Java에서 "new"키워드를 사용하여 HttpResponse 객체를 만들 수 있습니까?
private Source response_to_client(String msg) {
HttpResponse response = new HttpResponse();
response.setResponse(msg);
ByteArrayInputStream stream = encode_to_stream(response);
return new StreamSource(stream);
}
하지만 내가 HttpResponse
클래스를 얻을 수있는 자바의 모든 라이브러리를 찾을 수 없습니다 다음 RestfulTeams에서
이 반환하는 방법처럼 편안한 WS에 대한 간단한 HttpResponse
가있다 운동 위의 메서드 에서처럼이 개체를 직접 만들 수는 없다고 생각합니다.)
이 문제를 해결하는 방법에 대한 설명이 도움이 될 것입니다.