What should I use in abc.java? RequestDispatcher or ReDirect?? If it requestDispatcher then forward or include??
Whether you forward or redirect depends upon if you want to render the JSP in the same request as the servlet (forward), or cause a new request to be generated to fetch the JSP (redirect).
The latter is most often used in the PRG pattern, and by separating server-side control into task controllers and page controllers.
More details on PRG can be found in this article.
How do I send data from abc.java to xyz.jsp? Also I don't just wanna display it, but display it in tabular format. So, where do I do all the formatting of the data? On abc.java or xyz.jsp?
Noopur Kore wrote:do sendRedirect() method just sends you to the next page or It can send data from abc.java to xyz.jsp?
A redirect sends a response to the browser that tells it to issue another request to the redirect URL. You can "pass" data in the session, or by adding request parameters to the URL.
Redirecting to a JSP is discouraged. you should redirect to the page controller for the JSP.
How do I send data from abc.java to xyz.jsp?
During a forward, by creating scoped variable in request scope. During a redirect, see above.
Also I don't just wanna display it, but display it in tabular format. So, where do I do all the formatting of the data? On abc.java or xyz.jsp?
What do you think? Where would you place the HTML to format the table?