title: How to redirect to a custom page on @PreAuthorize error?
body: <p>I want to redirect to a custom html page on an <code>@PreAuthorize</code> authentication error?</p>
  
  <p>I have used <code>@PreAuthorize("hasRole("Admin"))</code> for a controller. So if the user doesn't have the Admin role he will be kicked out and I am seeing authentication error.</p>
  
  <p>But I want to override this authentication failure error and redirect the user to standard error page I developed.</p>
  
  <p>Is there a solution for it ?</p>
  
  <p>Code:</p>
  
  <pre><code>@PreAuthorize("hasRole("Admin")){
  public List&lt;Object&gt; getBooksList(String id){
      return bookList;
  }
  </code></pre>