public ProfileLocator createLocator(RequestContext context) { try { ProfileLocator locator = (ProfileLocator) beanFactory.getBean( this.locatorBean, ProfileLocator.class); locator.init(this, context.getPath(), ((context.getRequest() != null) ? context.getRequest().getServerName() : null)); return locator; } catch (Exception e) { log.error("Failed to create locator for " + this.locatorBean + " error : " + e.getLocalizedMessage()); } return null; }