I am trying to use display tag for my ArrayList passed from action class.
Action Class
public List<AccessLog> getAccessLogList() throws ParseException
{
AccessLogManager am = new AccessLogManager(Config.getInstance());
ArrayList<AccessLog> accessLogList = new ArrayList<AccessLog>();
accessLogList = am.getAccessLog(userId, actionId, searchStartDate, searchEndDate);
HttpSession sessAccessLog = req.getSession();
sessAccessLog.setAttribute("accessLogListSession", accessLogList);
return accessLogList;
}
JSP Page
<display:table id="accessLogList" name="accessLogList" requestURI="SessionLogAction" pagesize="10" defaultsort="1" >
<display:column property="accessLogId" title="LogId" sortable="true" headerClass="sortable" />
<display:column property="username" title="Username" sortable="true" headerClass="sortable"/>
<display:column property="actionName" title="Action" sortable="true" headerClass="sortable"/>
<display:column property="description" title="Description" sortable="true" headerClass="sortable"/>
<display:column property="remark" title="Remark"/>
<display:column property="timeStamp" title="TimeStamp" sortable="true" headerClass="sortable"/>
</display:table>
Although I can see the first page in HTML, all the pagelinks (such as 2,3,etc..) are not working. So I am trying to pass the arraylist value in Session. But I am facing new error again.
My question is How can I make the page links to work in Display Tag with struts2. I found example with struts1, but not with struts2. Thanks in advance.
finally I fixed it.
Please use the action name that will be map to the specific action. It works perfectly.
for example: