Hi,
I am using a
servlet that calls a bean which does a backend query and gets some Values as Elements. I am not using
JDBC connections but using JCO connections to connect to SAP and get the required table Values. I have stored the table values into an Arraylist as follows in my Servlet
ComputeSearchBean Search=new ComputeSearchBean();
ArrayList beans = new ArrayList();
for(int i=0; i<Project_Prps.getNumRows(); i++){
Project_Prps.setRow(i);
int j=0;
Search.setWBSXYZ(Project_Prps.getString("XYZ"));
j=j+1;
Search.setWBSABC(Project_Prps.getString("ABC"));
beans.add(Search);
}
Then a call the required
JSP file in which i should use the table values as
req.getSession(true).setAttribute("Search1", beans);
String url = "/Search.jsp"; //relative url for display jsp page
ServletContext sc = getServletContext();
RequestDispatcher rd = sc.getRequestDispatcher(url);
rd.forward(req, resp);
My question is how to implement the JSP which will have the results diplayed as 50 elements per page. User can then use the next or previous to scroll across the webpage to see more results. How should i take care of the session so that through out the session user will see the results for his queries.
And i am talking about search results that could be 0 results or 500 results. dynamically how should i write the jsp page so that it displays them in a table in the center of the page.
Thanks and any help will be greatly appreciated.
John