Page Submit error
Friends,
I have a problem here. I am not able to submit this jsp by clicking next button which submit to action "/ivrreports/reports"
But I am able to open the intended page by going to URL:
http://localhost:9080/ivrreports/reports
It may look silly to you I spent 5 hours on this one, But I am not able figure it what I am doing wrong until now. Please help me.
Here is my jsp code:
<%@page language="java"%>
<%@page import="java.util.*"%>
<%@page import="com.caremark.ivr.beans.CallSummaryByDateBean"%>
<%@page import="com.caremark.ivr.common.ReportConstants"%>
<html>
<head>
<title>Call Summary By Date�</title>
<meta http-equiv="Expires" content="-1" />
<meta http-equiv="Pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
<link rel="stylesheet" href="css/screen_date.css" type="text/css" media="screen, print" />
</head>
<body>
<jsp:useBean id="ivrcs" scope="page" class="com.caremark.ivr.common.IVRCallSummary"/>
<center><h2>CALL SUMMARY BY DATE</h2></center>
<%
int records_per_page = 20;
int page_start_record = 0;
String start_record = (String)request.getAttribute(ReportConstants.PAGESTARTRECORD);
if(start_record != null && !(start_record.equals(""))){
page_start_record = Integer.parseInt(start_record);
}
int page_end_record = 0;
String end_record = (String)request.getAttribute(ReportConstants.PAGEENDRECORD);
if(end_record != null && !(end_record.equals(""))){
page_end_record = Integer.parseInt(end_record);
}
if(page_end_record == 0){
page_end_record = records_per_page;
}
ArrayList list = new ArrayList();
list = (ArrayList)request.getAttribute(ReportConstants.CALLSUMMARYLIST);
if(list == null) {
list = ivrcs.getcallSummaryByDate("");
}
%>
<%
int totalrecords = list.size();
if(list.size()>0 && list != null) {
%>
<table border="1" cellpadding="1" cellspacing="1">
<thead>
<tr>
<th width="10%"><font face="arial">Call Date</font></th>
<th width="13%"><font face="arial">Call Time (Hour)<br>(Central Time)</font></th>
<th width="7%"><font face="arial">Total Calls</font></th>
<th width="8%"><font face="arial">Requested Transfers</font></th>
<th width="9%"><font face="arial">% of Requested Transfers</font></th>
<th width="8%"><font face="arial">Forced Transfers</font></th>
<th width="9%"><font face="arial">% of Forced Transfers</font></th>
<th width="8%"><font face="arial">Retries Exceeded Transfers</font></th>
<th width="9%"><font face="arial">% of Retries Exceeded Transfers</font></th>
<th width="8%"><font face="arial">Hang Ups</font></th>
<th width="9%"><font face="arial">% of Hang Ups</font></th>
</tr>
</thead>
<tbody>
<%
//for(int i=0; i<list.size(); i++){
for(int i=page_start_record; i<page_end_record; i++){
CallSummaryByDateBean csbdb = new CallSummaryByDateBean();
csbdb = (CallSummaryByDateBean)list.get(i);
%>
<% if( i%2 == 0) {%>
<tr class="odd">
<%}
else{
%>
<tr class="even">
<%}%>
<td width="10%" align="center"><font face="arial"><%=csbdb.getCallDate()%></font></td>
<td width="13%" align="center"><font face="arial"><%=csbdb.getCallTime()%></font></td>
<td width="7%" align="center"><font face="arial"><%=csbdb.getTotalNoOfCalls()%></font></td>
<td width="8%" class="numberalign"><center><font face="arial"><%=csbdb.getTotalNoOfReqXfers()%></font></center></td>
<td width="9%" align="center"><font face="arial"><%=csbdb.getPercOfReqXfers()%></font></td>
<td width="8%" align="center"><font face="arial"><%=csbdb.getTotalNoOfForcedXfers()%></font></td>
<td width="9%" class="numberalign"><center><font face="arial"><%=csbdb.getPercOfForcedXfers()%></font></center></td>
<td width="8%" align="center"><font face="arial"><%=csbdb.getTotalNoOfRetExXfers()%></font></td>
<td width="9%" align="center"><font face="arial"><%=csbdb.getPercOfRetExXfers()%></font></td>
<td width="8%" align="center"><font face="arial"><%=csbdb.getTotalNoOfHangUps()%></font></td>
<td width="9%" align="center"><font face="arial"><%=csbdb.getPercOfHangUps()%></font></td>
</tr>
<%
}
%>
</tbody>
</table>
<table width='100%' border='0'>
<tr>
<td colspan='100%' align='right'>
<form name="myform" method="get" action="/ivrreports/reports">
<input type="hidden" name="<%=ReportConstants.PAGESTARTRECORD%>" value="<%=page_start_record%>">
<input type="hidden" name="<%=ReportConstants.PAGEENDRECORD%>" value="<%=page_end_record%>">
<input type="hidden" name="<%=ReportConstants.RECORDSPERPAGE%>" value="<%=records_per_page%>">
<input type="hidden" name="<%=ReportConstants.CALLSUMMARYLIST%>" value="<%=list%>">
<%if(page_start_record >= records_per_page){%>
<input type="Submit" name="Previous" value="Previous">
<%}if(page_end_record < totalrecords){%>
<input type="Submit" name="Next" value="Next">
<%}%>
</form>
</td>
</tr>
</table>
<%
}
else {
%>
No data was found to display that matches you criteria
<%
}
%>
<%@ include file="jsp/reportsfooter.jsp" %>
</body>
</html>
Please help me. Thanks in advance.