title: My Spring Controller is public @ResponseBody Map<String, String> but I also want to handle redirections
body: <p>I am calling a method from Ajax and I am responding with</p>
  <p><code>@ResponseBody Map&lt;String, String&gt;</code></p>
  <p>My functionality is okay! But my problem is when the user is not logged in and is calling to this method directly by the url. In this case, I don't want my controller to answer with</p>
  <p><code>@ResponseBody Map&lt;String, String&gt;</code></p>
  <p>I want my controller to answer with a redirection to the login page.</p>
  <p>I am using</p>
  <p><code>public ModelAndView</code></p>
  <p>to accomplish this state in other cases, but  I don't know how to handle this situation.</p>