Hi,
I'm saving an image as a blob using the following, but I'm not sure how to carry a message through the final redirect to display to the user:
JSP file:
<%
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
String action = blobstoreService.createUploadUrl("/servletimg");
%>
<form method="POST" action="<%= action %>" enctype="multipart/form-data">
...
</form>
The target servlet:
public class ServletImg extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse resp)
{
saveImg(...);
req.setAttribute("msg", "worked ok!");
resp.sendRedirect("/");
}
}
The final jsp page we get redirected back to:
if (request.getAttribute("msg") == null) {
Log.e("Hey we're missing the expected attribute!!!");
}
It all works ok, my image gets saved etc, but I don't see the "msg" attribute when redirected back to the main jsp page. Is there a way to carry a message through, or do I have to append it as parameters in the redirect, like:
resp.sendRedirect("/?msg=it worked ok!");
Thanks