Skip to content

Commit e1deeff

Browse files
committed
Quote JSON attrs properly.
1 parent 5cccefb commit e1deeff

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tutorials/pojo_webapp/src/main/java/org/gradle/PredictServlet.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ public void doGet (HttpServletRequest request, HttpServletResponse response) thr
4242
// Build a JSON response for the prediction.
4343
StringBuilder sb = new StringBuilder();
4444
sb.append("{\n");
45-
sb.append(" labelIndex : ").append(p.labelIndex).append(",\n");
46-
sb.append(" label : \"").append(p.label).append("\",\n");
45+
sb.append(" \"labelIndex\" : ").append(p.labelIndex).append(",\n");
46+
sb.append(" \"label\" : \"").append(p.label).append("\",\n");
4747
sb.append(" \"classProbabilities\" : ").append("[\n");
4848
for (int i = 0; i < p.classProbabilities.length; i++) {
4949
double d = p.classProbabilities[i];

0 commit comments

Comments
 (0)