I am calling a java servlet when a form is submitted like this
<form action="/doStuff" method="post" enctype="multipart/form-data">
In side my servlet I do some stuff and make a Object, and now I want to go back to the page where the call was made and give that page this data.
So I am currently doing this
String json = new Gson().toJson(packingListData);
response.setContentType("application/json");
response.setCharacterEncoding("UTF-8");
response.getWriter().write(json);
response.sendRedirect("/home.jsp");
If I leave of response.sendRedirect("/home.jsp");
this line I see the object printed out of the page localhost:9080/doStuff
So how can I go back to the page the form was submitted on and get that data?
Thanks