diff options
author | Manolo Carrasco <manolo@apache.org> | 2014-01-20 09:18:59 +0100 |
---|---|---|
committer | Manolo Carrasco <manolo@apache.org> | 2014-01-20 09:18:59 +0100 |
commit | 2dee8fb23ce1e6cf6ac8d227c01d3bc499fb5aeb (patch) | |
tree | a218fd1b7acc8dd2ead67a03cb26b843254419aa /gwtquery-core/src/test/java | |
parent | 7a5db3ca23d4db216aa705d0a9790293a672adc0 (diff) | |
parent | 1698ef35053af4ed3e22a5f9602e35ec2e8cf8e4 (diff) | |
download | gwtquery-2dee8fb23ce1e6cf6ac8d227c01d3bc499fb5aeb.tar.gz gwtquery-2dee8fb23ce1e6cf6ac8d227c01d3bc499fb5aeb.zip |
Merge branch 'mcm_jsonbuilder_jvm' of github.com:gwtquery/gwtquery into mcm_jsonbuilder_jvm
Diffstat (limited to 'gwtquery-core/src/test/java')
-rw-r--r-- | gwtquery-core/src/test/java/com/google/gwt/query/servlet/GQAjaxTestServlet.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/gwtquery-core/src/test/java/com/google/gwt/query/servlet/GQAjaxTestServlet.java b/gwtquery-core/src/test/java/com/google/gwt/query/servlet/GQAjaxTestServlet.java index a41dd1d7..5152de4c 100644 --- a/gwtquery-core/src/test/java/com/google/gwt/query/servlet/GQAjaxTestServlet.java +++ b/gwtquery-core/src/test/java/com/google/gwt/query/servlet/GQAjaxTestServlet.java @@ -10,6 +10,8 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; +import com.google.gwt.query.client.plugins.ajax.Ajax; + public class GQAjaxTestServlet extends HttpServlet { private static final long serialVersionUID = 1L; @@ -29,16 +31,14 @@ public class GQAjaxTestServlet extends HttpServlet { @Override protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { - String t = req.getParameter("timeout"); if (t != null && t.matches("\\d+")) { try { int ms = Integer.parseInt(t); - System.out.println(" Sleeping: " + ms); + System.out.println(name + "sleeping: " + ms); Thread.sleep(ms); } catch (Exception e) { } - System.out.println(name + "timeout"); return; } @@ -49,11 +49,13 @@ public class GQAjaxTestServlet extends HttpServlet { data = req.getParameter("callback") + "(" + data + ");"; } } else if (req.getMethod().equalsIgnoreCase("post") - && req.getContentType().toLowerCase().startsWith("application/json")) { + && req.getContentType() != null + && req.getContentType().toLowerCase().startsWith(Ajax.JSON_CONTENT_TYPE)) { BufferedReader reader = req.getReader(); String line; - while ((line = reader.readLine()) != null) + while ((line = reader.readLine()) != null) { data += line; + } } String origin = req.getHeader("Origin"); |