* @param request the HttpServletRequest instance
* @param response the HttpServletResponse instance
* @return the name of the next view
*/
public View process(HttpServletRequest request, HttpServletResponse response) throws ServletException {
final Blog blog = (Blog)getModel().get(Constants.BLOG_KEY);
String type = request.getParameter("type");
if (type == null) {
type = "approved";
}
String pageAsString = request.getParameter("page");
int page = 1;
if (pageAsString == null || pageAsString.length() == 0) {
page = 1;
} else {
try {
page = Integer.parseInt(pageAsString);
} catch (NumberFormatException nfe) {
}
}
List responses = null;
if (type.equalsIgnoreCase("pending")) {
responses = new ArrayList(blog.getPendingResponses());
} else if (type.equalsIgnoreCase("rejected")) {
responses = new ArrayList(blog.getRejectedResponses());
} else {
responses = new ArrayList(blog.getApprovedResponses());
}
Pageable pageable = new Pageable(responses) {
public List getListForPage() {
List responses = new ArrayList();