dcsimg
How would one view multiple database records over several pages instead of one?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Geoff_Winsor
Posted On:   Friday, January 28, 2005 01:38 PM

Hi, I am new to struts and JSP and am working on an application that accesses a database and returns multiple records as DTOs (class name "Annotation")into an ArrayList. Within my Action class: ArrayList resultList=new ArrayList(); resultList= dataAccessObject.getRecords(); // returns an ArrayList of Annotation" objects The ArrayList is then placed as an attribute in the session object: HttpSession session=request.getSession(); session.setAttribute("resultList",resultList); I then access the ArrayList in the JSP page. as:    More>>

Hi,

I am new to struts and JSP and am working on an application that accesses a database and returns multiple records as DTOs (class name "Annotation")into an ArrayList.



Within my Action class:



ArrayList resultList=new ArrayList();

resultList= dataAccessObject.getRecords(); // returns an ArrayList of Annotation" objects



The ArrayList is then placed as an attribute in the session object:


HttpSession session=request.getSession();

session.setAttribute("resultList",resultList);



I then access the ArrayList in the JSP page. as:













The above code works fine, however several hundred results can be returned and I would like to view/navigate around 20 of them at a time (similar to google results). I am familiar with the tag's 'offset' and 'length' attibutes and am wondering what the best approach would be to dynamically set this value. I would be open to completely different approaches to solving this problem as well and appreciate any suggestions.

Thanks,
Geoff

   <<Less

Re: How would one view multiple database records over several pages instead of one?

Posted By:   Christopher_Koenigsberg  
Posted On:   Saturday, January 29, 2005 07:55 AM

Take a look at displaytag.sourceforge.net
About | Sitemap | Contact