My problem is as follow: I am making an AJAX call to a jsp and from their am getting a JSON Object comprising of a flag and an ArrayList
JSP:
Gson gson = new Gson();
JsonObject root = new JsonObject();
root.addProperty("flag", flag); //add flag
root.addProperty("list", gson.toJson(list));
out.println(gson.toJson(root));
Now in the success function of my AJAX function I want to move to some other jsp so I did something like this:
success: function(response){
alert(JSON.stringify(response.list));
//alert(JSON.stringify(response.flag));
if(JSON.stringify(response.flag).indexOf("true")>=0){
location.href="GroupLoginScreen.jsp";
}
else{
alert("UNSUCCESSFUL");
}
}
Now, The problem part is though am getting the results here correct But how to send this list as an argument in URL with GroupLoginScreen.jsp so that at receiving end it can be obtained by just doing something like this:
ArrayList<String> list1 = (ArrayList<String>)request.getAttribute("mylist");