• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlet redirection

 
Sameer rathore
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anybody help me in returning a list or array object from a servlet to JSP page ?
 
Madhu Kaparapu
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set your array list object to request object with a unique name as shown below. And using requestdispatcher you can forward this attribute (ie arraylist object) to desired jsp page. At jsp page your access that attribute and display the information.

request.setAttribute("arraylist",yourArrayListObject);
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher(<<myPage.jsp>> ;
dispatcher.forward(request, response);
 
Sameer rathore
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the support.because of this i have finished first module of my job.Thanks again.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!