This code prints out the content of whats in the result.jsp and does not render the content that has been written to PrintWriter object got from the HttpServletResponse. Can someone explain this behavior?
forward should be called before the response has been committed to the client (before response body output has been flushed). If the response already has been committed, this method throws an IllegalStateException. Uncommitted output in the response buffer is automatically cleared before the forward.
Hope that explains why you are unable to view your out.println statements. It gets cleared before the result.jsp is called.