Issue
I have an interceptor, and under a certain condition I want to send a string response to the browser and then halt execution completely.
How can I do this?
Solution
Override the preHandle method and return false if you want to stop execution.
@Override
public boolean preHandle(HttpServletRequest request,
HttpServletResponse response, Object handler) throws Exception {
response.getWriter().write("something");
return false;
}
Answered By - Kevin Bowersox