hi pankaj,
thank u for ur response;
this is JSP code;
<%@ include file="init.jsp" %>
<%@ page import="java.util.*,example.Player"%>
<%
ArrayList arr = new ArrayList();
String array[]= {"aa","bb","cc","dd","ee","ff"};
for(int i=0;i<array.length;i++)
{
Player per= new Player();
per.setName(array[i]);
arr.add(per);
}
request.setAttribute("list",arr);
%>
<display:table name="list" pagesize="5" id="table1">
<display:column property="name" title="NAME" sortable="true"/>
</display:table>
if the whole code in in single jsp this is working fine;
but when write this code in controller;my controller is
package example;
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.PrintWriter;
import java.io.IOException;
import java.util.ArrayList;
public class Controller extends HttpServlet
{
private static final String CONTENT_TYPE = "text/html; charset=windows-1252";
ArrayList arr = new ArrayList();
public void init(ServletConfig config) throws ServletException
{
super.init(config);
}
public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
HttpSession session = request.getSession();
String array[]= {"aa","bb","cc","dd","ee","ff"};
for(int i=0;i<array.length;i++)
{
Player per= new Player();
per.setName(array[i]);
arr.add(per);
}
session.setAttribute("list",arr);
System.out.println("in controller =="+session.getAttribute("list"));
getServletContext().getRequestDispatcher("/TAG.jsp").forward(request,response);
}
}
this
servlet is in example package the jsp is not in example package now my jsp code is
<%@ include file="init.jsp" %>
<%@ page import="java.util.*,example.Player"%>
<%
ArrayList list=(ArrayList) session.getAttribute("list");
%>
<display:table name="list" pagesize="5" id="table1">
<display:column property="name" title="NAME" sortable="true"/>
</display:table>
first 5 records r coming properly but when i click next or sorting page not found is displayed.
i found the problem but i am way of solving the problem;
first time when u see the properties the path is
http://192.168.68.214:9000/example/Controller on next the hyperlink the path is
http://192.168.68.214:9000/example/TAG.jsp?d-2449-p=2; thats why its coming error;did u faced this error;
bye
chaitanya