responses = new ArrayList(blog.getRejectedResponses());
} else {
responses = new ArrayList(blog.getApprovedResponses());
}
Pageable pageable = new Pageable(responses) {
public List getListForPage() {
List responses = new ArrayList();
BlogService service = new BlogService();
Iterator it = super.getListForPage().iterator();
while (it.hasNext()) {
try {
responses.add(service.getResponse(blog, (String)it.next()));
} catch (BlogServiceException e) {
// do nothing - some responses just won't get shown,
// but a message will be sent to the blog
}
}
return responses;
}
};
pageable.setPageSize(PAGE_SIZE);
pageable.setPage(page);
getModel().put("pageable", pageable);
getModel().put("type", type);
return new ResponsesView();