0
我有這樣的HTTP標頭的HTTP標頭:添加參數使用Java Web服務
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
,我想的是加入2參數:mytotalcount和mytotalresult。
我必須添加到我的反應然而,這是不工作我不能這樣做:
response.Headers.Add("mytotalcount", "10");
也做不到
request.setAttribute("mytotalcount","10");
所以我阻止任何想法嗎?謝謝你的幫助 !
下面是部分代碼:
public class SitesResponse {
private Result result;
private List<GeographicSite> site;
public SitesResponse() {
this.result = new Result();
this.site = new ArrayList<GeographicSite>();
}
public List<GeographicSite> getSite() {
return site;
}
public void setSite(List<GeographicSite> site) {
this.site = site;
}
} 套房L'AUTRE CLASSE魁利用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);
//////////////////////////////////////////////////:::::::
在圖片在這裏我想補充我的兩個參數result from SOAPui
「它不工作」發生了什麼?你有錯誤嗎? – 2016-03-15 17:47:41
好吧,它不工作,我得到一個紅線!無論是刪除,重命名,或創建一個方法setAttribute !!!!! – Hopeful