dt-Source: Hibernate and JDBC data sources for DisplayTag
Examples


Here is an example how to use DisplayTag with dt-Source inside JSP.
	
	<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
	<%@ taglib prefix="dtsource" uri="http://dt-source.sf.net" %>    
	...
        <dtsource:hibernate pagesize="2" id="hibernateTable" list="users" sizelist="sizeusers" defaultsortName="id" entity="User" alias="u">
                select ~alias~ from ~entity~ as ~alias~ order by ~sort~
        </dtsource:hibernate>
        <display:table name="users" sort="external" pagesize="2" id="hibernateTable" partialList="true" size="sizeusers" requestURI="">
                <display:column property="id" sortable="true" sortName="id" title="Id #" />
                <display:column property="username" sortable="true" sortName="username" title="Login" />
                <display:column property="password" sortable="false" sortName="password" title="Password" />
                <display:column property="created" sortable="true" sortName="created" title="Created Date" />
        </display:table>
	...
	
	
Above is Hibernate-powered variant. In this example we assume that you want to show already properly mapped User entity with fields id, username, password and created.
Next one is JDBC powered example for table simple_user.
	
	...
        <dtsource:jdbc pagesize="2" id="jdbcTable" list="users" sizelist="sizeusers" defaultsortName="suUserId" table="simple_user" alias="u">
                select * from ~table~ as ~alias~ order by ~sort~
        </dtsource:jdbc>
        <display:table name="users" sort="external" pagesize="2" id="jdbcTable" partialList="true" size="sizeusers" requestURI="">
                <display:column property="suUserId" sortable="true" sortName="suUserId" title="Id #" />
                <display:column property="suUsername" sortable="true" sortName="suUsername" title="Login" />
                <display:column property="suPassword" sortable="false" sortName="suPassword" title="Password" />
                <display:column property="suCreated" sortable="true" sortName="suCreated" title="Created Date" />
        </display:table>               
	...
	
	
It's important to have proper configuration of Spring's application context in your Web application before usage. Be sure that your included all required libraries by DisplayTag and Spring. Of course, dt-Source needs to be included as well.