0

The code I have written in Servlet is as follows:

ArrayList news=admindelegate.getNewsdelegate();//this is defined already
request.setAttribute("news",news);
rd = request.getRequestDispatcher("ViewNews2.jsp");
rd.forward(request,response);

and my JSP code is:

ArrayList newslist=null;
	  ArrayList newslist=(ArrayList)request.getAttribute("news");
	  int newscount= newslist.size();
	  System.out.println("newscount:"+newscount);
	  if(!newslist.isEmpty())
	  {
	  for(int i=0;i<newscount;i++)
	   {
		   %>

	<tr>
	<Td><%=newslist.get(0)%></Td>
                <Td><%=newslist.get(1)%></Td>
	</tr>
        <%
	    }
	  }
	%>

But this table is not displaying the required data.Please help me..

2
Contributors
1
Reply
6
Views
8 Years
Discussion Span
Last Post by peter_budo
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.