Estou tendo este problema ao utilizar o sendRedirect, o erro que aparece:
***HTTP Status 500 – Internal Server Error
Message Cannot call sendRedirect() after the response has been committed
***Description The server encountered an unexpected condition that prevented it from fulfilling the request.
*
**java.lang.IllegalStateException: Cannot call sendRedirect() after the response has been committed
org.apache.catalina.connector.ResponseFacade.sendRedirect(ResponseFacade.java:488)
br.com.alura.gerenciador.servlet.AlteraEmpresaServlet.doPost(AlteraEmpresaServlet.java:45)
javax.servlet.http.HttpServlet.service(HttpServlet.java:661)
javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)**
Note The full stack trace of the root cause is available in the server logs.
Ficarei extremamente grato se puderem me auxiliar! :)