title: How to return response as Json from spring filter?
body: <p>In spring rest I need to send authentication error from doFilter() of my filter class. In response i need to send json with fields like status, message and errorCode. Kindly suggest how to achieve. We are not using spring boot.Below is the sample response on Authentication error</p>
  
  <p>{   "responseCode":" Error code",
      "responseMessage": "Some Error message",
      "responseStatus":"Fail"
  }</p>
  
  <p>Inside doFiler(), i am validating token, if its not valid I need to send above sample response.</p>