Merge r8739, r8744 from maint-rel-vivo-1.3 branch

This commit is contained in:
ryounes 2011-07-20 19:25:54 +00:00
parent ae61e162e6
commit d3fb0d8f50
2 changed files with 3 additions and 4 deletions

View file

@ -487,7 +487,7 @@ public class IndividualController extends FreemarkerHttpServlet {
String formatParam = (String) vreq.getParameter("format"); String formatParam = (String) vreq.getParameter("format");
if ( formatParam == null ) { if ( formatParam == null ) {
Matcher m = URI_PATTERN.matcher(url); Matcher m = URI_PATTERN.matcher(url);
if ( m.matches() && m.groupCount() == 1 ) { if ( m.matches() && m.groupCount() == 1 ) {
ContentType c = checkAcceptHeaderForLinkedDataRequest(url, vreq); ContentType c = checkAcceptHeaderForLinkedDataRequest(url, vreq);
if ( c != null ) { if ( c != null ) {
String redirectUrl = "/individual/" + m.group(1) + "/" + m.group(1) ; String redirectUrl = "/individual/" + m.group(1) + "/" + m.group(1) ;
@ -753,7 +753,7 @@ public class IndividualController extends FreemarkerHttpServlet {
body.put("title","Individual Not Found"); body.put("title","Individual Not Found");
body.put("errorMessage", "The individual was not found in the system."); body.put("errorMessage", "The individual was not found in the system.");
return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body); return new TemplateResponseValues(Template.TITLED_ERROR_MESSAGE.toString(), body, HttpServletResponse.SC_NOT_FOUND);
} }
public static Map<String, Float> getAcceptedContentTypes() { public static Map<String, Float> getAcceptedContentTypes() {

View file

@ -274,8 +274,7 @@ public class IndividualListController extends FreemarkerHttpServlet {
} else { } else {
log.debug("Docs size is 0"); log.debug("Docs size is 0");
} }
// Test index < hitCount ensures that there are still some docs left if ( hitCount > INDIVIDUALS_PER_PAGE ){
if ( hitCount > INDIVIDUALS_PER_PAGE && index < hitCount ){
rvMap.put("showPages", Boolean.TRUE); rvMap.put("showPages", Boolean.TRUE);
List<PageRecord> pageRecords = makePagesList(hitCount, INDIVIDUALS_PER_PAGE, page); List<PageRecord> pageRecords = makePagesList(hitCount, INDIVIDUALS_PER_PAGE, page);
rvMap.put("pages", pageRecords); rvMap.put("pages", pageRecords);