// redirect to the default workspace if directly addressing the
// servlet
// and if the default workspace name is not null (in which case we'd
// need
// to login to find out the actual workspace name, SLING-256)
SlingRepository slingRepo = (SlingRepository) getRepository();
if (slingRepo.getDefaultWorkspace() == null) {
response.sendError(
HttpServletResponse.SC_NOT_FOUND,
"JCR workspace name required, please add it to the end of the URL"
+ " (for the Jackrabbit embedded repository the default name is 'default') ");
} else {
String uri = request.getRequestURI();
if (pinfo == null) {
uri += "/";
}
uri += slingRepo.getDefaultWorkspace();
response.sendRedirect(uri);
}
}
super.service(request, response);