ActionErrrors are stored in the request. You put them there by calling the saveErrors(..) method on your Action's superclass. This process is the same no matter which method you use to return an ActionForward.
Hi Merrill. There's no problem when I use this to return actionforward:
But using this doesn't render the proper error messages.
return new ActionForward("/merchant.jsp?id="+num, true);
This is the code in my jsp file that suppose to print out any error or successful message:
Joined: Feb 15, 2005
The problem is with the second parameter of the ActionForward constructor. If you specify true for this parameter, that means that the sendRedirect() method will be called on the HTTPServletResponse object. When this happens, a new request is generated, meaning any objects associated with the old request, including error messages are now out of scope. You can fix this either by specifying false for this parameter, or by calling the saveErrors(session, errors) method, which puts the errors in the HTTPSession rather than the request.
Joined: Apr 02, 2006
It did work. For the sake who may get in this trouble this is what i did exactly: