1 Reply Latest reply on Feb 16, 2006 2:26 PM by chris griffith

    IllegalStateException

    Tomasz Zab?ocki Newbie

      Here is my troubling issue:

      this is the source code:

      public class MovieSearchControllerServlet extends HttpServlet
      {
      public void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException
      {
      String option = request.getParameter("option");
      if(!request.isUserInRole("FSUser")
      && !request.isUserInRole("FSAdmin") && option.equals("delete"))
      {
      response.reset();
      RequestDispatcher view = request.getRequestDispatcher("/FSWise/loginerror.jsp");
      view.forward(request,response);
      }

      and after i access the resource i get:

      java.lang.IllegalStateException: Cannot forward after response has been committed
      pl.com.filmservice.web.MovieSearchControllerServlet.doGet(MovieSearchControllerServlet.java:96)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
      javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)

      why is that?