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

Hibernate - HibernateException: createQuery is not valid without active transaction