Using Displaytag with tiles

Bookmark and Share
If you run the example in the previous post, with each click on the related table you will see that the URL has changed to reflect that of the JSP
http://localhost:8090/StrutsPaging/pages/search.jsp?d-3999332-p=2
This may cause problems when using Struts with tiles. In order to avoid the problem you have to change add a new attribute to the display:* tag
requestURI=""
In the JSP file in step 2 of "Struts: Paging and Sorting with Displaytag", change the display:table tag, change the tag to look as shown below:
<display:table name="sessionScope.empList" pagesize="4" id="empTable" sort="external" defaultsort="1" defaultorder="ascending" requestURI="">
Now, the URL appears as shown below
http://localhost:8090/StrutsPaging/search.do?d-3999332-o=2&d-3999332-s=empName&d-3999332-p=1&d-3999332-n=1
This solution in mentioned in the displaytag FAQ page(Had to dig a little to find it :) ). Once you have done this, you can safely use it with tiles too.

{ 0 comments... Views All / Send Comment! }

Post a Comment