Код: Выделить всё
HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 15 Mar 2016 17:08:29 GMT
Мне нужно добавить это в свой ответ, но это не работает, я не могу:
Код: Выделить всё
response.Headers.Add("mytotalcount", "10");
Код: Выделить всё
request.setAttribute("mytotalcount","10");
Вот часть кода:
Код: Выделить всё
public class SitesResponse {
private Result result;
private List site;
public SitesResponse () {
this.result = new Result();
this.site = new ArrayList();
}
public List getSite() {
return site;
}
public void setSite(List site) {
this.site = site;
}
Затем другой класс, использующий SitesResponse
Код: Выделить всё
SitesResponse response = new SitesResponse();
Код: Выделить всё
if (testiing) {
try {response = siteManager.geographicSitesAPIV1(args);
response.getResult().setCode("error");
response.getResult().setLabel("no addr found");
Код: Выделить всё
System.out.println(response.toString().getBytes().toString()+"azezae");
// request.Headers.Add("headername", "headervalue");
// request.setAttribute("X-Total-Count","10");
//response.setAttribute("X-Result-Count", "7");
//response.setIntHeader("mytotalcount", 5);
//////////////////////////////////////////////////:::::::
Подробнее здесь: https://stackoverflow.com/questions/360 ... webservice
Мобильная версия