Baptiste Metge
Baptiste Metge

Reputation: 189

How to build a server side datable with tapestry or datatable while coding in java ?

I'm a really new user of DataTables considering I just start an intership. I'm working on a JAVA project on eclipse using Tapestry. Plus, I'm using hibernate to create query to request data from the database.

We are using DataTable on the client side for now with javascript and requesting the data on a mySQL Database. Considering we got pretty large data, sometimes request are quite long. And well, I supposed to improve that.

After a few search I think I should be using server-side processing, right ?

The thing is : there is a lot of choice here : http://datatables.net/development/server-side/ and I don't know which one to choose ? Considering I'm using Tapestry, my DataTable is made in a .tml (Tapestry Markup Language) page, which seems to me to be a html page with tapestry extension and we use javascript in it to display our DataTable, do you have any tips for me to implement server side processing ?

Any help is apreciate,

thanks a lot,

Baptiste.

Upvotes: 1

Views: 764

Answers (2)

lance-java
lance-java

Reputation: 27994

I'm going to assume that you are using the DataTable component from tapestry-jquery

The DataTable component requires a "source" parameter which is a GridDataSource. This interface supports paging. The tapestry/hibernate integration provides a HibernateGridDataSource implementation which you can extend to support paging for a custom hibernate query.

Tapestry has a built in coercion from array/list to GridDataSource so when dealing with small collections you can pass a list/array as the source of a grid / datatable. For larger collections, you should always use the more scalable GridDataSource.

Upvotes: 2

user2464620
user2464620

Reputation: 68

The first step in making your requests faster is to understand why it is going slow. Don't try to rush into a quick fix when you're not sure whats going on. Like you said, this is for an internship, take the time to learn something more about databases. Doing so will hopefully lead to a proper implementation and the performance changes you are looking for.

Upvotes: 1

Related Questions