I am using the onload method in the form like below in one of my servlet:
out.write("<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\"> \n");
out.write("<html><body onload=\"document.forms[0].submit()\">\n");
out.write("<form method=\"POST\" action=\"http://ipaddress:8085/internal/Logout\">\n");
out.write("<input type=\"hidden\" name=\"groupId\" value=\"" + groupId
+ "\"/>\n");
out.write("<input type=\"hidden\" name=\"userName\" value=\""
+ userName + "\"/>\n");
out.write("<input type=\"hidden\" name=\"idpServer\" value=\""
+ idpServer + "\"/>\n");
out.write("<input type=\"hidden\" name=\"sessionId\" value=\""
+ sessionId + "\"/>\n");
out.write("<input type=\"hidden\" name=\"targetPage\" value=\""
+ targetPageURL + "\"/>\n");
out.write("<input type=\"hidden\" name=\"locale\" value=\""
+ locale + "\"/>\n");
out.write("<input type=\"hidden\" name=\"logoutPage\" value=\""
+ logoutPage + "\"/>\n");
out.write("</form>\n</body>\n</html>\n");
After the above code i have one more line which is like
deleteExpiredSession(sessionId);
In the first code block we have 'onload' method which will automatically submits the form to action url but in my case it is not happening the control is going to some other servlet.
- In debug mode the code executing along with the second part of code(deleteExpiredSession(sessionId);), I think the second part should not be executed because the above code is having onload. Earlier it was working fine but suddenly it is stopped working. I think recently we migrated to tomcat6 - tomcat7. Is this the reason? Any suggestions would be great.