String json1 = new Gson().toJson(list);
System.out.println(json1);
request.getSession().setAttribute("json1", json1);
I checked the logs it prints string like : ["090856","056986"]
In JSP I wrote something line below in script
var n = '<%= session.getAttribute("json1") %>';
alert(n);
The alert displayed 090856,056986
.
why such behaviour should not it display ["090856","056986"]
.
sometimes it also appears like this too