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[]{""};
        }
}

Comments

Popular posts from this blog

Oracle - duplicate fields in RECORD,TABLE or argument list are not permitted

Oracle - ORA-29282: invalid file ID, ORA-06512: at "SYS.UTL_FILE"