public DefaultSearchLocation getDefaultSearchLocationForCurrentUser() {
UserBean user = _currentUserService.getCurrentUser();
if (user != null && user.hasDefaultLocation()) {
return new DefaultSearchLocation(user.getDefaultLocationName(),
user.getDefaultLocationLat(), user.getDefaultLocationLon(), false);
}
RequestAttributes attributes = RequestContextHolder.currentRequestAttributes();
DefaultSearchLocation location = (DefaultSearchLocation) attributes.getAttribute(
KEY_DEFAULT_SEARCH_LOCATION_FOR_SESSSION,
RequestAttributes.SCOPE_SESSION);
return location;
}