deserialize json string with gson deserialize json string with gson json json

deserialize json string with gson


I solved with this code:

String lista = (String)request.getAttribute("lista");Gson gson = new Gson();                         Type listType = new TypeToken<ArrayList<Utente>>() {}.getType();ArrayList<Utente> users = new Gson().fromJson(lista, listType);


It suggests you have a StringMap where you have declared a Utente class. The source of the error is more than likely your users list