Index: modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java	(revision 57676)
+++ modules/dnet-orgs-database-application/trunk/src/main/java/eu/dnetlib/organizations/MyAccessDeniedHandler.java	(revision 57677)
@@ -20,16 +20,16 @@
 	private static Logger logger = LoggerFactory.getLogger(MyAccessDeniedHandler.class);
 
 	@Override
-	public void handle(final HttpServletRequest httpServletRequest, final HttpServletResponse httpServletResponse, final AccessDeniedException e)
+	public void handle(final HttpServletRequest req, final HttpServletResponse res, final AccessDeniedException e)
 			throws IOException, ServletException {
 
 		final Authentication auth = SecurityContextHolder.getContext().getAuthentication();
 
 		if (auth != null) {
-			logger.warn(String.format("User '%s' attempted to access the protected URL: %s", auth.getName(), httpServletRequest.getRequestURI()));
+			logger.warn(String.format("User '%s' attempted to access the protected URL: %s", auth.getName(), req.getRequestURI()));
 		}
 
-		httpServletResponse.sendRedirect(httpServletRequest.getContextPath() + "/authorizationRequest");
+		res.sendRedirect(req.getContextPath() + "/authorizationRequest");
 	}
 
 }
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/enrichments.html
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/enrichments.html	(revision 57676)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/html/enrichments.html	(revision 57677)
@@ -55,3 +55,4 @@
 		</div>
 	</div>
 </div>
+{{xxx}}
\ No newline at end of file
Index: modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js
===================================================================
--- modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js	(revision 57676)
+++ modules/dnet-orgs-database-application/trunk/src/main/resources/static/resources/js/organizations.js	(revision 57677)
@@ -97,6 +97,7 @@
 	$scope.vocabularies = {};
 
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.vocabularies = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -105,6 +106,7 @@
 	$scope.save = function() {
 		$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
 		$http.post('api/organizations/save', $scope.org).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 //			alert('Organization saved !!!');
 			$location.url('/metadata/1/' + res.data[0]);
 		}, function errorCallback(res) {
@@ -128,6 +130,7 @@
 	$scope.orgs = {};
 	
 	$http.get('api/organizations/search/' + $routeParams.page + '/' + $routeParams.size + '?q=' + $scope.fieldValue).then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.orgs = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -140,6 +143,7 @@
 	$scope.entries = [];
 	
 	$http.get('api/organizations/browse/countries').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.entries = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -154,6 +158,7 @@
 	$scope.orgs = [];
 	
 	$http.get('api/organizations/byCountry/' + $routeParams.code + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.orgs = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -166,6 +171,7 @@
 	$scope.entries = [];
 	
 	$http.get('api/organizations/browse/types').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.entries = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -180,6 +186,7 @@
 	$scope.orgs = [];
 	
 	$http.get('api/organizations/byType/' + $routeParams.type + '/' + $routeParams.page + '/' + $routeParams.size).then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.orgs = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -206,9 +213,11 @@
 	$timeout(function() { $scope.message = ''; }, 3000)
 		
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
+
 		$scope.vocabularies = res.data;
-
 		$http.get('api/organizations/get?id=' + $routeParams.id).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.org = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -220,8 +229,9 @@
 	$scope.save = function() {
 		$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
 		$http.post('api/organizations/save', $scope.org).then(function successCallback(res) {
-			if ($routeParams.msg == 2) { $route.reload(); }
-			else                       { $location.url('/metadata/2/' + res.data[0]); }
+			if      ((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
+			else if ($routeParams.msg == 2)         { $route.reload(); }
+			else                                    { $location.url('/metadata/2/' + res.data[0]); }
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
 		});
@@ -244,9 +254,12 @@
 	orgInfoService.getInfo($scope.orgId, function(info) { $scope.info = info; });
 	
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
+		
 		$scope.vocabularies = res.data;
 
 		$http.get('api/organizations/relations?id=' + $routeParams.id).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.rels = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -263,6 +276,7 @@
 		$http.put('api/organizations/relations', null, { 
 			'params': { 'from': $scope.orgId, 'to': $scope.newRelation.id, 'type': $scope.newRelType }
 		}).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.rels = res.data;
 			$scope.newRelType = '';
 			$scope.newRelation = {};
@@ -276,6 +290,7 @@
 		$http.delete('api/organizations/relations', { 
 			'params': { 'from': $scope.orgId, 'to': to, 'type': type }
 		}).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.rels = res.data;
 //			alert("Relation deleted !!!")
 		}, function errorCallback(res) {
@@ -286,6 +301,7 @@
 	$scope.search = function(text, page, size) {
 		$scope.orgs = [];
 		$http.get('api/organizations/search/' + page + '/' + size + '?q=' + text).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.searchValue = text;
 			$scope.searchOrgs = res.data;
 		}, function errorCallback(res) {
@@ -304,9 +320,12 @@
 	orgInfoService.getInfo($scope.orgId, function(info) { $scope.info = info; });
 	
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
+		
 		$scope.vocabularies = res.data;
 
 		$http.get('api/organizations/enrichments?id=' + $routeParams.id).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.enrichments = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -319,6 +338,7 @@
 	$scope.saveEnrichments = function() {
 		$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
 		$http.post('api/organizations/enrichments', $scope.enrichments).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			alert('Enrichments updated !!!');
 			$scope.enrichments = res.data;
 		}, function errorCallback(res) {
@@ -336,9 +356,12 @@
 	orgInfoService.getInfo($scope.orgId, function(info) { $scope.info = info; });
 	
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
+		
 		$scope.vocabularies = res.data;
 
 		$http.get('api/organizations/conflicts?id=' + $routeParams.id).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.conflicts = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -351,6 +374,7 @@
 orgsModule.controller('showAllConflictsCtrl', function ($scope, $http) {
 	$scope.conflicts = [];
 	$http.get('api/organizations/conflicts/all').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.conflicts = res.data;
 	}, function errorCallback(res) {
 		alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -364,9 +388,11 @@
 	$scope.superAdminMode = superAdminMode();
 	
 	$http.get('api/vocabularies').then(function successCallback(res) {
+		if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 		$scope.vocs = res.data;
 
 		$http.get('api/users').then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.users = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -383,6 +409,7 @@
 	$scope.saveUser = function(user) {
 		$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8";
 		$http.post('api/users', user).then(function successCallback(res) {
+			if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 			$scope.users = res.data;
 		}, function errorCallback(res) {
 			alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
@@ -392,6 +419,7 @@
 	$scope.deleteUser = function(email) {
 		if (confirm("Are you sure ?")) {
 			$http.delete('api/users?email=' + email).then(function successCallback(res) {
+				if((typeof res.data) == 'string') { alert("Session expired !"); location.reload(true); }
 				$scope.users = res.data;
 			}, function errorCallback(res) {
 				alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')');
