我怎样才能摆脱这里的潦草书写?
<liferay-ui:search-container>
<liferay-ui:search-container-results
results="<%= BookLocalServiceUtil.getBooks(searchContainer.getStart(), searchContainer.getEnd()) %>"
total="<%= BookLocalServiceUtil.getBooksCount() %>"
/>
答案 0 :(得分:0)
我找到了解决方案!
在.jsp
中<liferay-ui:search-container> <liferay-ui:search-container-results results="${bookListArray}" />
在render
方法中:
String pageName = request.getParameter("pageName");
List<Book> bookList = null;
try {
bookList = BookLocalServiceUtil.getBooks(QueryUtil.ALL_POS, QueryUtil.ALL_POS);
} catch (SystemException e1) {
e1.printStackTrace();
}
request.setAttribute("bookListArray", bookList);