Вот мой метод перехватчика, где я хочу, чтобы установить пользовательский ответ сказать UI, что произошлоУстановка пользовательского ответа весной перехватчик
@Override
public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
throws Exception {
HttpSession session = request.getSession(false);
if (session != null)
return true;
else{
response.sendError(HttpServletResponse.SC_REQUEST_TIMEOUT)
return false;
}
}
И в web.xml
<error-page>
<error-code>408</error-code>
<location>/error.html</location>
</error-page>
весна-сервлет. xml
<mvc:interceptors>
<mvc:interceptor>
<mvc:mapping path="/**" />
<mvc:exclude-mapping path="/login" />
<bean class="com.example.CustomInterceptor" />
</mvc:interceptor>
</mvc:interceptors>
Когда сеанс завершен, он не отправляет никакого ответа после возврата false. Даже ниже не работает
response.sendRedirect("http://localhost:8080/home");
Как вы полный URL выглядит? –