I am doing login application. I am encrypting the username and password parameters in login jsp and then I am sending it to servlet. In servlet I decrypt the username and password and dispatch to LoginAction page.Code as below
if(counter < loginLimit)
{
try{
String sessionid = request.getSession(false).getId();
response.setHeader("SET-COOKIE", "JSESSIONID=" + sessionid + "; HttpOnly");
}
catch(Throwable t)
{
GenericExceptionLog.log("DPLoginActionServlet :::: getting error::"+loginId+" @ "+new java.sql.Timestamp(new java.util.Date().getTime()),"DPLoginActionServlet");
}
RequestDispatcher reqdisp=request.getRequestDispatcher(postLogin);
reqdisp.forward(request,response);
return;
}
but it givimg me java.lang.IllegalStateException: JBWEB000232: Cannot forward after response has been committed Occured