For sorting and pagination data, you can use Jquery for showing and hiding the data, they are more effective than server side implementation of java.
There are lot of plugin available.
you can check these links for example