title: Spring - handling access denied exception
body: <p>In my app I want to handle <code>AccessDeniedException</code> and return Json content in response for that. Can someone explain how to do this? I can't find answer. I tried to catch Exception using <code>@ExceptionHandler</code> but I always get redirect to log in page. I'm writing just api so I don't need whole mvc. </p>
  
  <p>Any ideas?</p>