Strabon

changeset 272:8b75a4e15e4b

Decoding the SPARQLquery parameter
author Kostis Kyzirakos <kkyzir@di.uoa.gr>
date Wed Jun 13 11:22:02 2012 +0300 (2012-06-13)
parents fe2694dc1bf3
children a2270d7ce584 215a496f0410
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	Wed Jun 13 01:24:53 2012 +0300
     1.2 +++ b/endpoint/src/main/java/eu/earthobservatory/org/StrabonEndpoint/QueryBean.java	Wed Jun 13 11:22:02 2012 +0300
     1.3 @@ -8,6 +8,7 @@
     1.4  import java.io.PrintWriter;
     1.5  import java.io.UnsupportedEncodingException;
     1.6  import java.math.BigInteger;
     1.7 +import java.net.URLDecoder;
     1.8  import java.net.URLEncoder;
     1.9  import java.security.SecureRandom;
    1.10  import java.util.Date;
    1.11 @@ -101,7 +102,10 @@
    1.12  
    1.13  		DataHive hive = new DataHive(); 
    1.14  
    1.15 -		hive.setSPARQLQuery(request.getParameter("SPARQLQuery"));
    1.16 +		String encoding = "UTF-8";
    1.17 +		String q = URLDecoder.decode(request.getParameter("SPARQLQuery"), encoding);
    1.18 +		
    1.19 +		hive.setSPARQLQuery(q);
    1.20  
    1.21  		String reqFormat = (request.getParameter("format") == null) ? "" : request.getParameter("format");
    1.22  		String reqAccept = (request.getHeader("accept") == null) ? "" : request.getHeader("accept");