make it a little easier to find the starting page

This commit is contained in:
Erik Forkalsrud 2013-07-03 01:37:50 -07:00
parent e177e571f4
commit 5a8966abb3

View file

@ -216,6 +216,13 @@ public class AlbumServlet
req.setAttribute("mapper", new Mapper()); req.setAttribute("mapper", new Mapper());
String pathInfo = req.getPathInfo(); String pathInfo = req.getPathInfo();
// help the user get to the top level page
if (pathInfo == null || "/".equals(pathInfo)) {
String u = req.getContextPath() + "/album/" + base.getName() + ".album";
res.sendRedirect(u);
return;
}
try { try {
if (pathInfo != null && pathInfo.startsWith(basePrefix)) { if (pathInfo != null && pathInfo.startsWith(basePrefix)) {
pathInfo = pathInfo.substring(basePrefix.length()); pathInfo = pathInfo.substring(basePrefix.length());