1

I need to show almost 300k data in the Data table if I am trying to set all data one time in the Data table then data table becoming slow, please suggest a way IN JSP pages where I can show large data in Data tables.

1
  • 1
    You can use hibernate pagination to only send limited data from back-end initially and request to back-end for more data only on user's action, for more refer to baeldung.com/hibernate-pagination Also only using datatable in JSP would not solve your problem . Commented Jul 24, 2020 at 16:47

1 Answer 1

2

Like Nagesh Tripathi wrote, you will need pagination with lazy loading to make this efficient. With plain JSP this is pretty hard to do. Maybe you want to use JSF with PrimeFaces? In that case I can recommend you the following article that discusses how this can be done efficiently: https://blazebit.com/blog/2017/primefaces-datatable-pagination.html

Here is another example that shows how you can use the pagination feature of Blaze-Persistence on top of JPA with Angular on the front-end: https://github.com/Blazebit/blaze-persistence/tree/master/examples/spring-data-webmvc

Sign up to request clarification or add additional context in comments.

3 Comments

thank you Christian Beikov for you suggestion, can we solve this by using cashing?
If the data is static, caching might be a way to go, but I guess its not. Anyway, sending megabytes of tabular data is never a good idea, you should always use a pagination mechanism. A user rarely wants to see all data in the browser. A user should use filters to find the data that is needed.
ok thanks, suggest me to how to apply pagination and will data table search option will work in pagination, in JSP because now I am not in a position to change technology

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.