Question

 Catalog catalogs= product.getAllCatalog();

 request.setAttribute("catalogs",catalogs); 
  ..
 ...
...

so when i am dispatching request to the JSP page with large no of catalogs size it causing OutOfMemoryErrors .

can some one tell me how to fixed this problem ,any way to fixed this problem.

Était-ce utile?

La solution

Pagination can solve you problem .and in each iteration i.e when moving to next page clear your 1 level cache it can solve your problem .

For more infomation about how to implement pagination with example click here

Autres conseils

Pagination is the way to go, don't load everything at once and load only required fields from Catalog

try to use pagination or create a collection of beans that only hold the data that you really need

For example if you only display field1, field2 and field3 or your Catalog then create a bean with only these fields

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top