Ok, I'm very new to
JSP, so forgive me if this is a simple one. I'm working on fixing some errors in a page (one that I did not write myself unfortunately) and I keep getting a "Cannot forward because the response has already been committed" 500 Error.
I've narrowed it down to where I'm doing a forward() of my RequestDispatcher object, and I've read various topics on it that have told me this is happening because I've committed some output already. My question is how do I find where that is. Here's the code in the method that calls forward().
RequestDispatcher rd = getServletContext().getRequestDispatcher("/index.jsp");
HttpSession session = request.getSession(true);
session.setAttribute("user_type", "volunteer");
session.setMaxInactiveInterval( 60 * 15);
session.setAttribute("loggedin", "true");
if (rd != null)
{
rd.forward(request, response);
}
If anyone has any suggestions or if there's any other part of the code that might help just let me know.