Has anyone noticed such an error previously? I've written a Java app that submits a form to a servlet (using Tomcat 3.3 and Apache 1.3.20--Java SDK 1.3.1) when a user wishes to save page values. I found that when the user presses the Save button on the JSP page, the servlet registers that a POST was made, then after some business logic executes, the servlet registers that a second POST was made. I'm checking on the page (using Javascript) that the button, even if pressed twice, will not submit the form twice, so I'm somewhat confused. Further, when I perform the same action using IE 5.00.2314, my servlet only registers that a single POST was made, as I expect. I've included the JSP below. I haven't seen any reference made to this issue on the Microsoft site or any other forums I've checked. Thanks in advance for any help.
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<%@ page language="java" %>
<%@ page import="model.uiBeans.*,java.util.*,functionality.*,com.Roles,java.lang.Integer, servlets.SuperServlet"%>
<%@ taglib uri="tims" prefix="tims"%>
<%@ taglib uri="logic" prefix="logic" %>
<jsp:useBean id="functionality" scope="session" class="functionality.StudyFunctionality" />
<jsp:useBean id="user" class="model.baseBeans.BaseUser" scope="session"/>
<SCRIPT language="JavaScript1.1">
var submitted = false;
function processSubmit(actionDest) {
if (!submitted){
submitted = true;
StudyTestAnalytes.action=actionDest;
if (actionDest=="/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save" {
bSubmit=verify(StudyTestAnalytes,1);
if (bSubmit==true){StudyTestAnalytes.submit();}
}
else {
StudyTestAnalytes.submit();
}
}
}
function verify(f,verifyFrom){
var errors="";
var msg;
for (var i=0;i<f.length;i++){
var e = f.elements;
if (e.type=="text"{
if (e.name=="TargetConcentration"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Concentration field is not numeric. Enter a numeric Target Concentration.\n";
}
}
if (e.name=="TargetUpper"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Upper Concentration field is not numeric. Enter a numeric Target Upper Concentration.\n";
}
}
if (e.name=="TargetLower"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Lower Concentration field is not numeric. Enter a numeric Target Lower Concentration.\n";
}
}
}
}
if (!errors) return true;
if (verifyFrom==0) {
msg = "_______________________________________________________________\n\n";
msg += "The form was not submitted because of the following error(s).\n";
msg += "Please correct these error(s) and re-submit.\n";
msg += "_______________________________________________________________\n\n";
msg += errors;
alert(msg);
}
return false;
}
</SCRIPT>
<html>
<%
response.setHeader("Cache-Control","no-cache"
response.setHeader("Pragma","no-cache"
response.setDateHeader("Expires",0);
%>
<tims:security user="<%=user%>" roles="<%= Roles.STUDY %>">
<head>
<tims:HeaderTag />
</head>
<BODY background="/<%=SuperServlet.getApplicationName() %>/images/bk_blueyell.gif">
<timsageTitle covHeader="Study Maintenance" />
<form method="POST" name="StudyTestAnalytes" onSubmit="return verify(this,0);">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="140" ></td>
<td width="556" align="left" valign="top"> <img border="0" src="/<%=SuperServlet.getApplicationName() %>/images/pixel.gif" width="20" height="20">
</td>
<td width="69" ></td>
</tr>
<tr>
<tims:LinksSideBar />
<td width="100%" align="left" valign="top">
<table width="100%" align="left" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left">
<table border=0>
<tr>
<td align="right">Study:</td>
<td align="left"><%= functionality.getStudyNumber() %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<table border=1>
<tr>
<td>
Study Test Name
</td>
<td>
Analyte Name
</td>
<td>
Log In
</td>
<td>
Units
</td>
<td>
Target<br>Concentration
</td>
<td>
Target<br>Lower
</td>
<td>
Target<br>Upper
</td>
<td>
Target<br>Comments
</td>
</tr>
<% Vector studyTestAnalytes = functionality.getStudyTestAnalytes();
int i=0;
String storedStudyTestName="";
for (Enumeration e = studyTestAnalytes.elements() ; e.hasMoreElements() {
UiStudyTestAnalyteData testAnalyte = (UiStudyTestAnalyteData)e.nextElement(); %>
<tr>
<% if (i==0){ %>
<td><INPUT type="Text" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>" readonly></INPUT></td>
<% }else if ((i>0) && (!testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type="Text" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>" readonly></INPUT></td>
<% }else if ((i>0) && (testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type="hidden" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>"></INPUT></td>
<% }storedStudyTestName=testAnalyte.getStudyTestName();
i=i+1; %>
<td><INPUT type="Text" name="AnalyteName" value="<%= testAnalyte.getAnalyteName() %>" readonly></INPUT></td>
<td>
<tims:buildList collection="<%= functionality.getAutoLoginValues() %>" listName="LogIn" listSize="0" onChange="" type="model.uiBeans.UiLookup" value="getDescription" display="getDescription" selectedValue="<%= testAnalyte.getLogIn() %>"></tims:buildList>
<td>
<tims:buildList collection="<%= functionality.getAllUnits() %>" listName="Unit" listSize="0" onChange="" type="model.uiBeans.UiLookup" value="getDescription" display="getDescription" selectedValue="<%= testAnalyte.getUnits() %>" initialValue="0" initialDisplay=""></tims:buildList>
</td>
<td><INPUT type=text name="TargetConcentration" size=5 value= <%=testAnalyte.getTargetConcentration() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetLower" size=5 value=<%=testAnalyte.getTargetLower() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetUpper" size=5 value=<%=testAnalyte.getTargetUpper() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetComments" size=50 value="<%=testAnalyte.getTargetComments() %>" onChange=""></INPUT></td>
</tr>
<% } %>
</table>
</td>
</tr>
</td>
</table>
<!-- fourth table cell is a spacer column - 25 pixels wide - between content and right side of screen-->
<td width="69" rowspan="2" ><img src="/<%=SuperServlet.getApplicationName() %>/images/pixel.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="140" ></td>
<td width="556" align="left" valign="top"> <!-- text links -->
</td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" value="Save Study" onClick="processSubmit('/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save');"></input></td>
</tr>
<tr>
<td> </td>
<% String defaultErrorString = "";
if (session.getAttribute("Error"!=null && !(session.getAttribute("Error".equals(defaultErrorString))){
Exception error=(Exception)session.getAttribute("Error"
String exName = error.getClass().getName();
if (exName.toUpperCase().equals("FUNCTIONALITY.STUDYTESTNOANALYTESEXCEPTION") { %>
<td><FONT color="#FF0000"><%= error.getMessage() %></FONT></td>
<% }
} %>
<tr>
</table>
<!-- Close the web form to submit the data -->
</form>
</BODY>
</tims:security>
</html>
<%@ page contentType="text/html;charset=WINDOWS-1252"%>
<%@ page language="java" %>
<%@ page import="model.uiBeans.*,java.util.*,functionality.*,com.Roles,java.lang.Integer, servlets.SuperServlet"%>
<%@ taglib uri="tims" prefix="tims"%>
<%@ taglib uri="logic" prefix="logic" %>
<jsp:useBean id="functionality" scope="session" class="functionality.StudyFunctionality" />
<jsp:useBean id="user" class="model.baseBeans.BaseUser" scope="session"/>
<SCRIPT language="JavaScript1.1">
var submitted = false;
function processSubmit(actionDest) {
if (!submitted){
submitted = true;
StudyTestAnalytes.action=actionDest;
if (actionDest=="/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save" {
bSubmit=verify(StudyTestAnalytes,1);
if (bSubmit==true){StudyTestAnalytes.submit();}
}
else {
StudyTestAnalytes.submit();
}
}
}
function verify(f,verifyFrom){
var errors="";
var msg;
for (var i=0;i<f.length;i++){
var e = f.elements;
if (e.type=="text"{
if (e.name=="TargetConcentration"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Concentration field is not numeric. Enter a numeric Target Concentration.\n";
}
}
if (e.name=="TargetUpper"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Upper Concentration field is not numeric. Enter a numeric Target Upper Concentration.\n";
}
}
if (e.name=="TargetLower"{
var x = parseFloat(e.value);
if (isNaN(x)){
errors+="- The Target Lower Concentration field is not numeric. Enter a numeric Target Lower Concentration.\n";
}
}
}
}
if (!errors) return true;
if (verifyFrom==0) {
msg = "_______________________________________________________________\n\n";
msg += "The form was not submitted because of the following error(s).\n";
msg += "Please correct these error(s) and re-submit.\n";
msg += "_______________________________________________________________\n\n";
msg += errors;
alert(msg);
}
return false;
}
</SCRIPT>
<html>
<%
response.setHeader("Cache-Control","no-cache"
response.setHeader("Pragma","no-cache"
response.setDateHeader("Expires",0);
%>
<tims:security user="<%=user%>" roles="<%= Roles.STUDY %>">
<head>
<tims:HeaderTag />
</head>
<BODY background="/<%=SuperServlet.getApplicationName() %>/images/bk_blueyell.gif">
<timsageTitle covHeader="Study Maintenance" />
<form method="POST" name="StudyTestAnalytes" onSubmit="return verify(this,0);">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="140" ></td>
<td width="556" align="left" valign="top"> <img border="0" src="/<%=SuperServlet.getApplicationName() %>/images/pixel.gif" width="20" height="20">
</td>
<td width="69" ></td>
</tr>
<tr>
<tims:LinksSideBar />
<td width="100%" align="left" valign="top">
<table width="100%" align="left" cellspacing="0" cellpadding="2" border="0">
<tr>
<td align="left">
<table border=0>
<tr>
<td align="right">Study:</td>
<td align="left"><%= functionality.getStudyNumber() %></td>
</tr>
</table>
</td>
</tr>
<tr>
<td align="left">
<table border=1>
<tr>
<td>
Study Test Name
</td>
<td>
Analyte Name
</td>
<td>
Log In
</td>
<td>
Units
</td>
<td>
Target<br>Concentration
</td>
<td>
Target<br>Lower
</td>
<td>
Target<br>Upper
</td>
<td>
Target<br>Comments
</td>
</tr>
<% Vector studyTestAnalytes = functionality.getStudyTestAnalytes();
int i=0;
String storedStudyTestName="";
for (Enumeration e = studyTestAnalytes.elements() ; e.hasMoreElements() {
UiStudyTestAnalyteData testAnalyte = (UiStudyTestAnalyteData)e.nextElement(); %>
<tr>
<% if (i==0){ %>
<td><INPUT type="Text" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>" readonly></INPUT></td>
<% }else if ((i>0) && (!testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type="Text" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>" readonly></INPUT></td>
<% }else if ((i>0) && (testAnalyte.getStudyTestName().equals(storedStudyTestName))){ %>
<td><INPUT type="hidden" name="StudyTestName" value="<%= testAnalyte.getStudyTestName() %>"></INPUT></td>
<% }storedStudyTestName=testAnalyte.getStudyTestName();
i=i+1; %>
<td><INPUT type="Text" name="AnalyteName" value="<%= testAnalyte.getAnalyteName() %>" readonly></INPUT></td>
<td>
<tims:buildList collection="<%= functionality.getAutoLoginValues() %>" listName="LogIn" listSize="0" onChange="" type="model.uiBeans.UiLookup" value="getDescription" display="getDescription" selectedValue="<%= testAnalyte.getLogIn() %>"></tims:buildList>
<td>
<tims:buildList collection="<%= functionality.getAllUnits() %>" listName="Unit" listSize="0" onChange="" type="model.uiBeans.UiLookup" value="getDescription" display="getDescription" selectedValue="<%= testAnalyte.getUnits() %>" initialValue="0" initialDisplay=""></tims:buildList>
</td>
<td><INPUT type=text name="TargetConcentration" size=5 value= <%=testAnalyte.getTargetConcentration() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetLower" size=5 value=<%=testAnalyte.getTargetLower() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetUpper" size=5 value=<%=testAnalyte.getTargetUpper() %> onChange=""></INPUT></td>
<td><INPUT type=text name="TargetComments" size=50 value="<%=testAnalyte.getTargetComments() %>" onChange=""></INPUT></td>
</tr>
<% } %>
</table>
</td>
</tr>
</td>
</table>
<!-- fourth table cell is a spacer column - 25 pixels wide - between content and right side of screen-->
<td width="69" rowspan="2" ><img src="/<%=SuperServlet.getApplicationName() %>/images/pixel.gif" width="1" height="1"></td>
</tr>
<tr>
<td width="140" ></td>
<td width="556" align="left" valign="top"> <!-- text links -->
</td>
</tr>
<tr>
<td></td>
<td align="center"><input type="submit" value="Save Study" onClick="processSubmit('/<%=SuperServlet.getApplicationName() %>/Dispatch/Study_Save');"></input></td>
</tr>
<tr>
<td> </td>
<% String defaultErrorString = "";
if (session.getAttribute("Error"!=null && !(session.getAttribute("Error".equals(defaultErrorString))){
Exception error=(Exception)session.getAttribute("Error"
String exName = error.getClass().getName();
if (exName.toUpperCase().equals("FUNCTIONALITY.STUDYTESTNOANALYTESEXCEPTION") { %>
<td><FONT color="#FF0000"><%= error.getMessage() %></FONT></td>
<% }
} %>
<tr>
</table>
<!-- Close the web form to submit the data -->
</form>
</BODY>
</tims:security>
</html>