I have a "Page Expired" issue on IE if I specify the enctype="multipart/form-data"
in the form tag.
By simplifying, I have 3 JSP pages page1.jsp
, page2.jsp
and page3.jsp
.
page1.jsp
(which contains a form with enctype="multipart/form-data"
) submits to page2.jsp
and page2.jsp
submits to page3.jsp
.
If I:
I read about cache-control, but setting these page with cache-control private or public doesn't change the situation
// page1.jsp
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
<html>
<head>
</head>
<body>
<form method="post" enctype="multipart/form-data" action="page2.jsp">
File to upload: <input type=file name=upfile>
<input type=submit value="Go to page2">
</form>
// page2.jsp
<html>
<head>
</head>
<body>
<form method="post" action="page3.jsp">
<input type=submit value="Go to page3">
</form>
</body>
</html>
// page3.jsp
<html>
<head>
</head>
<body>
<form method="post" action="end.jsp">
<input type="button" value="Go to page 2" onclick="javascript:history.back();">
<input type=submit value="Go to end">
</form>
</body>
</html>
just use post-redirect-get paradigm:
this way, browsers will not ask to re-submit or display "page expired" on back pressed
however you can reduce the number of pages/servlets implementing this way:
page2.jsp
<%
if("POST".equals(request.getMethod())
{
// process submitted params/files
response.sendRedirect(request.getRequestURI()); // redirect to the same page
}
%>
<html>
blah blah blah
</html>
or you can simply use ajax.