请教怎样处理退后刷新页面的重复提交有关问题?多谢

请问怎样处理退后刷新页面的重复提交问题?谢谢
我写了一个的简单的BBS小例子:

遇到的问题,简单一点来说:reply.jsp和acceptReply.jsp

  reply.jsp是一个简单的表单页面,用来输入内容;acceptReply.jsp接受并存入数据库!

源代码(主要):
   
reply.jsp内容很简单,就是一个提交!

acceptReply.jsp源码:

<%@ page language="java" pageEncoding="GB18030"%>
<%@ page import="java.sql.*"%>
<%@ page import="com.shijian.bbs.*"%>



<%
//设置页面不缓存
/*
response.setHeader("Pragma", "No-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("EXpires", 0);
*/
  request.setCharacterEncoding("gbk");

  //从相应的reply页面获得的参数
String title = request.getParameter("title");
String content = request.getParameter("cont");
   
if (title == null || title.equals("") || content.equals("")
|| content == null) {
out.print("你的输入有误,请重新发帖!");
return;
}
String strPid = request.getParameter("pid");
String strRootid = request.getParameter("rootid");
int pid;
int rootid;
try {
pid = Integer.parseInt(strPid);
rootid = Integer.parseInt(strRootid);
} catch (NumberFormatException e) {
e.printStackTrace();
out.print("你的输入有误,请重新发帖!");
return;
}
  //连接数据库,并做相应的操作(封装在一个bean里,但实现的不怎么好,有待改进)
Connection con = DB.getConnection();
con.setAutoCommit(false);
String sql = "insert into article value (null, ?, ?, ?, ?, now(), ?)";
PreparedStatement pst = DB.getPreSt(con, sql);
pst.setInt(1, pid);
pst.setInt(2, rootid);
pst.setString(3, title);
pst.setString(4, content);
pst.setInt(5, 0);
pst.executeUpdate();
DB.close(pst);

Statement st = DB.createStatement(con);
String changeSql = "Update article set isleaf = 1 where id = "
+ pid;
st.executeUpdate(changeSql);

con.commit();

con.setAutoCommit(true);
DB.close(st);
DB.close(con);

  //以为是request对象的原因,但去掉也不行!
//request.removeAttribute("title");
//request.removeAttribute("cont");
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>

<script language="JavaScript1.2" type="text/javascript">
<!-- 
function delayURL(url, time) {
  setTimeout("top.location.href='" + url + "'", time);
}
-->
</script>

  </head>

<body onLoad="delayURL('article.jsp',3000)">
<center>
查看新发表帖子,三秒钟后会自动跳转<br>
<a href="article.jsp">若没有跳转,请点击链接!</a>
</center>
</body>

</html>


因为这有个三秒的自动跳转,但是我再次退回到acceptReply.jsp ,因为有三秒的延迟,我手动再次刷新页面,它就会再次提交和上一次同样的内容,并存入到数据库!

我是用了数据库的查看限制来做的,但觉得很不合理,效率也太低!我想问一下,大家是怎么做的?谢谢高手了!期盼中!

------解决方案--------------------
参考这个
Java进行程序的Post表单提交检查,防止非法和重复提交的分析