Possible Duplicate:
java.lang.IllegalStateException: Cannot forward after response has been committed
What is the usual cause of this kind of error:
com.mycompany.myapp.servlet.TxnDetailsServlet doRequest
ERROR: View failed
java.lang.IllegalStateException: Cannot forward after response has been committed
at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:312)
at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
at com.mycompany.myapp.servlet.TxnDetailsServlet.doRequest(TxnDetailsServlet.java:82)
at com.mycompany.myapp.servlet.TxnDetailsServlet.doGet(TxnDetailsServlet.java:131)
The servlet process the request (i.e set attributes) then call:
private void doRequest(HttpServletRequest request) throws IOException, ServletException {
// Code omitted
getServletContext().getRequestDispatcher("/Some.jsp").forward(this.request, this.response);
// Code omitted
}
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doGet(request, response);
doRequest(request);
}
@Override
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
super.doPost(request, response);
doRequest(request);
}
The servlet does not do anything in reponse.