Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

JSP getting submitted twice  RSS feed

 
Bonkur K Reddy
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
when i am submitting my form the form is getting submitted two times

the sample code is as follows
IN JSP
------
for(inti=0;inti<ArrCurrency.length;inti++){
if(ArrCurrency[inti].toUpperCase().trim() == document.frmReviewBranch.txtCurCode.value.toUpperCase().trim()){

blnValidCurCode = false;
document.frmReviewBranch.hdnOptPage.value = "BranchDetails";
document.frmReviewBranch.action='<%=IAllURLs.URL_ORDER_CONTROLSERVLET%>';
window.event.returnValue=false;
document.frmReviewBranch.submit();
//return;
break;
}else{
blnValidCurCode = true;
}
}
------
-----
IN SERVLET
----
----
if(strOptPage.equals("BranchDetails")){

String strCurrCode = null;
Date dtEnteredDate = null;
String strUrl = null;
Vector vecBranchDetails = null;

strCurrCode = request.getParameter("txtCurCode");
strCurrCode = strCurrCode.toUpperCase();
dtEnteredDate = Date.valueOf(request.getParameter("hdnOrdDate"));

OrderSessionBean osBean = new OrderSessionBean();

Vector vFetchCurrency = null;
Vector vFetchBchOrders = null;
Vector vFetchBchOrderDenoms = null;
Vector vFetchBranchCurDenoms = null;
Vector vFetchSummOrders = null;

vFetchCurrency = osBean.fetchCurrency();
vFetchBchOrders = osBean.fetchBchOrders(dtEnteredDate);
vFetchSummOrders = osBean.fetchSummaryBch(dtEnteredDate);
vFetchBchOrderDenoms = osBean.fetchBchOrderDenoms(dtEnteredDate);
vecBranchDetails = osBean.fetchBranchInfo(strCurrCode,strDivCode);
request.setAttribute(IAllConstants.ATR_HOO_DATE,dtEnteredDate.toString());

request.setAttribute("CurrencyCodes",strCurrCode);
request.setAttribute("vFetchCurrency",vFetchCurrency);
request.setAttribute("vFetchBchOrders",vFetchBchOrders);
request.setAttribute("vFetchSummOrders",vFetchSummOrders);
request.setAttribute("vecBranchDetails",vecBranchDetails);

strURL = IAllURLs.URL_HRB_PAGE2;

rqdDispatcher = context.getRequestDispatcher(strURL);
rqdDispatcher.forward(request, response);
return;

}
----
----
When I am submitting the form the cursor will be moved to the servlet in the code above after executing the code in servlet the focus is moved onto to form, again the form is getting submitted the same execution of the code is repeated again .

Can any one have the solution for this

thanks in advance
bk
 
SJ Adnams
Ranch Hand
Posts: 925
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had this problem once. Turned out to be the deployment xml.
HTH
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!