Pagination through Struts2 using DisplayTag Library Framework

后端 未结 5 1671
夕颜
夕颜 2021-01-16 18:13

I want to apply pagination for some class of my application, in which i am using spring, struts2 & hibernate. Here i am calling action class from welcome.jsp file. It ha

5条回答
  •  [愿得一人]
    2021-01-16 18:45

    You need make "countryList" available to DisplayTag, e.g. by doing something like:

       request.setAttribute("countryList", countryList);
    

    in your action (unless there's a cleverer Struts2 way of doing this). I think you can get hold of the request in your action by making it implement ServletRequestAware

    You also need to make sure that your Country class has id and name properties.

提交回复
热议问题