I'm currently working in a payment gateway kind of project. If any validation errors occurred in the back end, first I want to show the error message on my jsp page (Payment gateway's) and after 10seconds I want to dispatch the object(error code) to the merchant (merchant's web page) from my jsp page.
Currently, when I try to dispatch and forward in my jsp page, my error message/View content is not shown in the jsp. Instead of showing my error messages, it's just waiting for 10 seconds and forward the object to the merchant. Because I hope I'm not letting to commit request/response object in my jsp by doing the dispatching . Correct me if I'm wrong.
Please suggest me a good way to handle this situation?
I'm trying to do like this in my jsp page..
</head>
<body>
<form:form method="post" commandName="item">
<form:errors path="*" cssClass="errorblock" element="div" />
<tr>
<td>Response Code :</td><td>${item.responseCode}</td>
<%="test" %>
</tr>
<%
Thread.sleep(10000); // sleep 10 seconds
RequestDispatcher rd = request.getRequestDispatcher("/merchant.jsp");
//rd.include(request, response);
rd.forward(request, response);
%>
</body>