Strabon

changeset 173:072932f4751e

setContentLength and flush
author Michael Sioutis
date Mon May 21 20:49:35 2012 +0300 (2012-05-21)
parents a69499da7b01
children 2ecb0d2877a8 439c5e28e3bc
files endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java
line diff
     1.1 --- a/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Mon May 21 20:17:03 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Mon May 21 20:49:35 2012 +0300
     1.3 @@ -160,6 +160,7 @@
     1.4  		}
     1.5  
     1.6  		PrintWriter out = response.getWriter();
     1.7 +                out.flush();
     1.8  
     1.9  		if ((hive.getFormat().equalsIgnoreCase("KML")) || (hive.getFormat().equalsIgnoreCase("KMZ"))) {
    1.10  			StringBuilder errorMessage = new StringBuilder ();
    1.11 @@ -200,7 +201,10 @@
    1.12  			//response.setContentType("text/plain; charset=UTF-8");
    1.13                          response.setStatus(status_code);
    1.14  			if (status_code == HttpServletResponse.SC_OK) {
    1.15 -				response.getWriter().append(answer);
    1.16 +                                response.setContentLength(answer.length());
    1.17 +				//response.getWriter().append(answer.toString());
    1.18 +                                out.append(answer.toString());
    1.19 +                                out.flush();
    1.20  
    1.21  			} else {
    1.22  				response.getWriter().append(ResponseMessages.getXMLHeader());