I wanted to know how the sortable attribute adds the href of the column header while displaying on the table. when I click on the header table will be sorted. I am bit of newbie to Display tags.
As displaytag is open source you can browser their source code. And displaytag is nothing more than a bunch of jsp-tags writing html to the output stream.
How does displaytag create the header of the column as hyperlink for sorting?
The displaytag library puts together their table in the HtmlTableWriter
class (e.g. HtmlTableWriter at Github). There you can take a look at the getSortingHref()
-method. This method creates one link with the sorting parameters.
If you use a modern IDE and have the project configured to find the source code of your used libs (e.g. a eclipse maven project) you can most of the time jump into the declaration with Ctrl+click
on a tag like <display:column>
.