http response Header information
<p>so it may be a stupid question for some if not for all, but i have this response header : </p>

<pre><code>HTTP/1.1 200 OK
Server: Apache-Coyote/1.1
X-Atr: 10
X-Atr2: 1
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Tue, 29 Mar 2016 09:17:26 GMT
</code></pre>

<p>and the result that goes with it : </p>

<pre><code>{"site": [
  {
  "id": "1",
  "name": "James"
  },
   {
  "id": "2",
  "name": "Katia"
  },
  {
  "id": "3",
  "name": "Sam"
  }
</code></pre>

<p>What i want to do is to change <strong>HTTP/1.1 200 OK</strong> in case i get this i get something like <strong>HTTP/1.1 206 you have some results</strong>  and in the same time have the display the JSON result. and in case that we don't have any results it would be like:  <strong>HTTP/1.1 400 didn't find any result</strong> AND the JSON result would be like : </p>

<pre><code>[]
</code></pre>

<p>So what i have tried is the following : </p>

<pre><code>if (response.getSite().size() &lt;= 0) {
     responseHttp.sendError(HttpServletResponse.SC_ACCEPTED, "you have some    results"); 
    } else {

 responseHttp.sendError(HttpServletResponse.SC_ACCEPTED, "you have some    results");}
</code></pre>

<p>The thing is in both cases it edited HTTP/1.1 but doesn't display any message nor the JSON results. </p>

<p>hope i well explained my problème thank you for your time and help. </p>