}
protected void exposeProjectCategory(HttpServletRequest request, Object handler) {
if(handler instanceof RouteController) {
String categoryIdStr = request.getParameter("categoryId");
Project project = (Project) request.getAttribute(AttributeKeys.PROJECT_KEY);
Site site = (Site) request.getAttribute(AttributeKeys.SITE_KEY);
String categoryCode = (String) request.getAttribute("categoryCode");
ProjectCategory currentCategory = null;
if(StringUtils.isNotBlank(categoryIdStr)) {
currentCategory = categoryService.getProjectCategory(NumberUtils.createLong(categoryIdStr));
} else if(StringUtils.isNotBlank(categoryCode)) {
currentCategory = categoryService.getProjectCategory(site, categoryCode);
} else if(project!=null) {
currentCategory = project.getCategory();
}
request.setAttribute(AttributeKeys.PROJECT_CATEGORY_CURRENT_KEY_READABLE, currentCategory);
}
}