• 1 reply
  • Latest Post - ‏2013-05-08T19:10:58Z by gifty
6 Posts

Pinned topic Websphere 7 - Response already Commited error

‏2013-05-02T12:50:17Z | jsf was7


Is there any configuration changes to be done to avoid this error? I have this error when I run the code on WAS 7 server. It worked on WAS 6.1 server though. Both response.sendRedirect() and RequstDispatcher both doesn't work. Not sure where to point response commited. Please advise.

Here is the code snippet.

public Boolean isUserValid(){
        String id = (String)request.getParameter("id");
        response = (HttpServletResponse) context.getExternalContext().getResponse();
        System.out.println("+++ response:"+response.isCommitted());
        if(id != null && !id.equalsIgnoreCase("")){
            HTTPTrafficManager.setObjectInHttpSession(context, "empId",id);
      "+++++ Employee id removed from session and added empId from URL again +++" );
        } else if (HTTPTrafficManager.getObjectInHttpSession(context, "empId") != null){
            this.empNo = (String)HTTPTrafficManager.getObjectInHttpSession(context, "empId");
      "+++++ Retreived empId from session +++" );
            try {
//                    response.flushBuffer();
//                    response.sendRedirect(request.getContextPath()+"/faces/pn/noauth.jsp");
                    RequestDispatcher reqDispatcher = request.getRequestDispatcher(request.getContextPath()+"/faces/pn/noauth.jsp");
                    try {
                        reqDispatcher.forward(request, response);
                    } catch (ServletException e) {
                        // TODO Auto-generated catch block
                return null ;
            } catch (IOException ioe) {
                    _LOGGER.severe("???? IOException : "+ioe.getLocalizedMessage());
        return true;




Updated on 2013-05-02T12:58:21Z at 2013-05-02T12:58:21Z by AmitJain15
  • gifty
    18 Posts

    Re: Websphere 7 - Response already Commited error


    If the response is already committed then forward dispatch is not allowed per Java Servlet specification.

    If you are not able to pinpoint where the application code is committing the response then you will need to take webcontainer server traces for further analysis to find who is committing it prior to your forward dispatch.

    Get the trace string here ,