I am uploading an image through Servlet.
try{
//Image Upload Code
} catch(Exception e){
//Exception Handler
} finally {
request.setAttribute("job-id", jobId);
request.setAttribute("message", message);
System.out.println("SJA : " + message);
getServletContext().getRequestDispatcher("ReloadJob.jsp").forward(request, response);
}
Then, on ReloadJob.jsp, I am trying to use these attached attributes:
String jobId = request.getParameter("job-id");
String message = request.getParameter("message");
System.out.println("RJ : " + jobId);
System.out.println("RJ : " + message);
This whole process prints following output:
SJA : MESSAGE RECEIVED
RJ : BYWEGRI76T46U34T
RJ : null
Why is message variable null?