Posts

Showing posts from March, 2015

Java, Spring, Javascript: errorThrown SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Problema:
errorThrown SyntaxError: JSON.parse: unexpected character at line 1 column 1 of the JSON data

Solucion:
JSON esta esperando por lo menos un array vacio, un objecto tipo String (return new String()) no es suficiente.

@RequestMapping("/xxx")
public @ResponseBody String[] xxx(HttpServletRequest request, @RequestParam("xxxx") String xxx) {
            (...)
return new String[]{""};
        }
}