JSTL Calculate total of bean values [duplicate] - java

This question already has answers here:
Calculate total sum of all numbers in c:forEach loop
(7 answers)
Closed 6 years ago.
after a loop runs and populates a data table I want to calculate the totals of the columns and display them on the last row.
This is my code to populate the table...I need to build the last row:
<table class="data_table">
<tr>
<th>Source Of Issues</th>
<th>First Issues</th>
<th>second Issues</th>
<th>Changes</th>
</tr>
<c:forEach var="bean" items="${beans}" varStatus="loopCount">
<tr>
<td>${bean.sorCode}</td>
<td class="right"><fmt:formatNumber value='${bean.firstissue}'
type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${bean.secondissue}'
type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${bean.changes}'
type="currency" groupingUsed='true' /></td>
</tr>
</c:forEach>
</table>

<c:set var="sum" value="${0}"/>
<c:forEach var="bean" items="${beans}" varStatus="loopCount">
<c:set var="total" value="${bean.actualLabor + bean.plannedLabor}"/>
<tr>
<td>${bean.sorCode}</td>
<td class="right"><fmt:formatNumber value='${bean.firstissue}'
type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${bean.secondissue}'
type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${changes}'
type="currency" groupingUsed='true' /></td>
</tr>
<c:set var="sum" value="${sum + changes}"/>
</c:forEach>
<fmt:formatNumber value='${sum}' type="currency" groupingUsed='true' />

<table class="data_table">
<tr>
<th>Source Of Issues</th>
<th>First Issues</th>
<th>second Issues</th>
<th>Changes</th>
</tr>
<c:set var="plannedSum" value="${0}"/>
<c:set var="actualSum" value="${0}"/>
<c:set var="changesSum" value="${0}"/>
<c:forEach var="bean" items="${beans}" varStatus="loopCount">
<c:set var="plannedSum" value="${plannedSum + bean.firstissue}"/>
<c:set var="actualSum" value="${actualSum + bean.secondissue}"/>
<c:set var="changesSum" value="${changesSum + bean.changes}"/>
<tr>
<td>${bean.sorCode}</td>
<td class="right"><fmt:formatNumber value='${bean.firstissue}' type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${bean.secondissue}' type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${bean.changes}' type="currency" groupingUsed='true' /></td>
</tr>
</c:forEach>
<tr>
<td><a>Totals</a></td>
<td class="right"><fmt:formatNumber value='${plannedSum}' type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${actualSum}' type="currency" groupingUsed='true' /></td>
<td class="right"><fmt:formatNumber value='${changesSum}' type="currency" groupingUsed='true' /></td>
</tr>
</table>

Related

how to display "Model object Attribute ArrayList<String>" values as DROP DOWN values in JSP

<form:form action="saveNewUsers" method="post" modelAttribute="users">
<table>
<tr><td>Id</td>
<td><form:input path="id"/></td>
</tr>
<tr>
<td>User</td>
<td><form:input path="user" /></td>
</tr>
<tr>
<td>Password</td>
<td><form:input path="password" /></td>
</tr>
<tr>
<td>FirstName</td>
<td><form:input path="first_name" /></td>
</tr>
<tr>
<td>LastName</td>
<td><form:input path="last_name" /></td>
</tr>
<tr>
<td>Group Id</td>
<td>
<select name="GroupId">
<c:forEach items="${users.al}" var="item">
<option value="${item.value}">${item.value}</option>
</c:forEach>
</select>
</td>
<tr>
<td colspan="2" align="center"><input type="submit" value="Save"></td>
</tr>
</table>
Please let me know how to get ArrayList attribute from ModelObject of 'users' and print those values of ArrayList as DROPDOWN Menu in JSP.
Actually I send that 'users' model object from the Controller of the Spring MVC

Java based Selenium2: find element by preceding-sibling when source contains same element two times

I want to click a text related input with preceding-sibling node my HTML is the following:
<FORM id="formid" onsubmit="" method=post name="formid" action=>
<TABLE width="100%">
<TR class=foo-even>
<TD rowSpan=3><INPUT onclick="" value=1 type=radio name="formid">upbutton1</TD>
<TD>Pearl</TD>
<TD rowSpan=3></TD>
</TR>
<TR class=foo-even>
<TD>ravenclawn</TD>
</TR>
<TR class=foo-even>
<TD>ravenclawn</TD>
</TR>
</TBODY>
</TABLE>
</TD></TR>
<TR>
<TD> </TD>
</TR>
</TBODY></TABLE>
<TABLE width="100%" >
<TBODY>
<TR>
<TD class="someclass"></TD>
</TR>
<TR>
<TD>
<TABLE class=foo width="100%" border="1px">
<TBODY>
<TR class=foo-header>
<TD></TD>
<TD><BR></TD>
<TD colSpan=3></TD>
<TD></TD>
</TR>
<TR class=foo-odd>
<TD><INPUT value=0 type=radio name="formid.samename">buttonclick1</TD>
<TD>1234</TD>
<TD>blue </TD>
<TD colSpan=2>apple2</TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"></TD>
</TR>
<TR class=foo-even>
<TD><INPUT value=1 type=radio name="formid.samename">buttonclick2</TD>
<TD>1235 </TD>
<TD>blue </TD>
<TD colSpan=2>apple3</TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"> </TD>
</TR>
<TR class=foo-odd>
<TD><INPUT value=2 type=radio name="formid.samename">buttonclick3</TD>
<TD>1235</TD>
<TD>sometext </TD>
<TD>Pearl</TD>
<TD></TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"> </TD>
</TR>
<TR class=foo-even>
<TD><INPUT value=3 type=radio name="formid.samename">buttonclick4</TD>
<TD>1236 </TD>
<TD>blue </TD>
<TD colSpan=2>apple4</TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"> </TD>
</TR>
<TR class=foo-odd>
<TD><INPUT value=4 type=radio name="formid.samename">buttonclick5</TD>
<TD>1236 </TD>
<TD>sometext </TD>
<TD>ravenclawn</TD>
<TD></TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"> </TD>
</TR>
<TR class=foo-even>
<TD><INPUT value=5 type=radio name="formid.samename">buttonclick6</TD>
<TD>1237 </TD>
<TD>blue </TD>
<TD colSpan=2>apple6</TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"> </TD>
</TR>
<TR class=foo-odd>
<TD><INPUT value=6 type=radio name="formid.samename">buttonclick7</TD>
<TD>1237 </TD>
<TD>sometext </TD>
<TD>ravenclawn</TD>
<TD></TD>
<TD> <INPUT value=0 type=hidden name="samenameagain"></tD>
</DIV>
My target is to click on second Pearl text related input field
Selenium code is the following:
driver.findElement(By.xpath(".//td[contains(text(),'Pearl')][1]/preceding-sibling::td")).click();
Problem:
Above code always working with first table that contains Pearl text
Observations:
That case when im modify first Pearl text to something else the code working fine
That case when im working with another text ect:"ravenclawn" its working fine without any modifications
Thanks for any advice
You just include index for table also.
For 1st table
By.xpath("//table[1]//td[contains(text(),'Pearl')]/preceding-sibling::td")
For 2nd table
By.xpath("//table[2]//td[contains(text(),'Pearl')]/preceding-sibling::td")

How to select elements using Jsoup

I have table where I want to iterate over rows (tr) in root tbody and not rows in it child
I try this but with no success:
Elements tableRows = table.select("tr");
this get tr also in it child so I have there duplicates
Elements tableRows = table.select("tbody > td:first-child");
this doesnt work too
here is my table:
<table border="0" cellspacing="0" cellpadding="2" width="100%" align="center">
<tbody>
<tr>
<td class="head">Rank</td>
<td class="Head"> </td>
<td class="Lhead">Club</td>
<td class="head">Nation</td>
<td class="head">Rank points</td>
<td class="head">Five best results (by points)</td>
</tr>
<tr>
<td class="playerB">60. (1.)</td>
<td class="Lplayer">Imrich Blasko</td>
<td class="Lplayer">THC Blue Dragon Kosice</td>
<td class="player"><img src="flags/SVK.gif" alt="SVK" /></td>
<td class="playerB">3 398</td>
<td class="Lplayer">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="Lplayer">World Championships 2013</td>
<td class="Rplayer">817</td>
</tr>
<tr>
<td class="Lplayer">Czech Open 2012</td>
<td class="Rplayer">674</td>
</tr>
<tr>
<td class="Lplayer">Czech Open 2013</td>
<td class="Rplayer">668</td>
</tr>
<tr>
<td class="Lplayer">Slovak Championships 2013</td>
<td class="Rplayer">621</td>
</tr>
<tr>
<td class="Lplayer">Bratislava Cup 2013</td>
<td class="Rplayer">617</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="6">
<hr color="#008080" width="100%" /></td>
</tr>
<tr>
<td class="playerB">159. (2.)</td>
<td class="Lplayer">Tibor Valachovic ml.</td>
<td class="Lplayer">SHK Skalica</td>
<td class="player"><img src="flags/SVK.gif" alt="SVK" /></td>
<td class="playerB">2 847</td>
<td class="Lplayer">
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tbody>
<tr>
<td class="Lplayer">Czech Open 2013</td>
<td class="Rplayer">639</td>
</tr>
<tr>
<td class="Lplayer">Brno 2013</td>
<td class="Rplayer">594</td>
</tr>
<tr>
<td class="Lplayer">Brno 2014</td>
<td class="Rplayer">583</td>
</tr>
<tr>
<td class="Lplayer">Slovak Championships 2013</td>
<td class="Rplayer">569</td>
</tr>
<tr>
<td class="Lplayer">Czech Open 2011</td>
<td class="Rplayer">461</td>
</tr>
</tbody>
</table></td>
</tr>
<tr>
<td colspan="6">
<hr color="#008080" width="100%" /></td>
</tr>
</tbody>
</table>
Try:
Elements tableRows = table.select(":root > tbody > tr");

The method println(boolean) in the type PrintStream is not applicable for the arguments (void)

I want to print resultset value retrive from SQL JSTL tags.but it gave error
org.apache.jasper.JasperException: Unable to compile class for JSP:
An error occurred at line: 219 in the jsp file: /testVoucher.jsp
The method println(boolean) in the type PrintStream is not applicable for the arguments (void)
216:
217:
218: <%
219: System.out.println(
220: %>
221:
222: <%
An error occurred at line: 220 in the jsp file: /testVoucher.jsp
Syntax error, insert ")" to complete Expression
217:
218: <%
219: System.out.println(
220: %>
221:
222: <%
223: );
An error occurred at line: 223 in the jsp file: /testVoucher.jsp
Syntax error on token ")", delete this token
220: %>
221:
222: <%
223: );
224: %>
225:
226:
Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:439)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:334)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:312)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:299)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:586)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
The Main part of code is as follows
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT A.BANK_NAME,B.SCHEME_NAME SCHEME_DESC,
TO_CHAR(SUM(B.GROSS),'99,99,99,99,990.00') GROSS,
round(SUM(B.TDS),0) TDS,
TO_CHAR(SUM(B.ADVANCE),'99,99,99,99,990.00') ADVANCE,
TO_CHAR(SUM(B.PARTIAL),'99,99,99,99,990.00') PARTIAL,
TO_CHAR(SUM(B.NET),'99,99,99,99,990.00') NET
FROM VW_VOUCHER_ALLOCATION_DETAIL B, VW_SCHEME_ACCOUNT A
WHERE B.VOUCHER_NO='<%=voucher%>'
AND B.ID = A.EXPENSE_SCH_CODE
AND (B.GROSS>0 OR B.ADVANCE>0 OR B.PARTIAL>0)
GROUP BY A.BANK_NAME,B.SCHEME_NAME
ORDER BY A.BANK_NAME, B.SCHEME_NAME
</sql:query>
<sql:resultSet id="rs">
<tr style="height:20px">
<td CLASS="BORDER_"><b><sql:getColumn colName="BANK_NAME"/></b></td>
<td CLASS="BORDER_" ><sql:getColumn colName="SCHEME_DESC"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="GROSS"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="TDS"/></td>
<td CLASS="BORDER_" align="right" bgcolor="#e2d36d"><sql:getColumn colName="ADVANCE"/></td>
<td CLASS="BORDER_" align="right" bgcolor="#e2d36d"><sql:getColumn colName="PARTIAL"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="NET"/></td>
</tr>
/////it give error here ///////////////////////////
<%
System.out.println(
%>
<sql:getColumn colName="SCHEME_DESC"/>
<%
);
%>
</sql:resultSet>
Whole code is As follows:
<%# include file="/include_session_check.jsp" %>
<%# include file="/include_db_tld.jsp" %>
<%#page import="java.util.ArrayList"%>
<center>
<%!
ArrayList<String> BankName_list=new ArrayList<String>();
%>
<%
String voucher="2012-2013/001188";
//com.GEN_Utility.nvl(request.getParameter("voucher"));
ArrayList<String> Scheme_list=new ArrayList<String>();
ArrayList<Float> Gross_List=new ArrayList<Float>();
ArrayList<Float> TDS_List=new ArrayList<Float>();
ArrayList<Float> Adv_List=new ArrayList<Float>();
ArrayList<Float> Partial_List=new ArrayList<Float>();
ArrayList<Float> Net_List=new ArrayList<Float>();
System.out.println(" voucher "+voucher);
%>
<br>
<DIV CLASS="PGBREAK" STYLE="background-color: white; WIDTH: 800px;">
<table width="793" height="70">
<TR>
<TD width="55%">
<img src="<%=STRpath%>index/Logo_new.bmp">
</TD>
<TD width="45%"><br><b>Mirae Asset Global Investments(I) Pvt Ltd</b> <br>
Unit No. 606, 6th Floor, Windsor Bldg.,<br>
Off CST Road, Kalina, Santacruz(E),<br>
Mumbai - 400 098.<br>
www.miraeassetmf.co.in
</TD>
</TR>
</table>
<hr width="793" noshade="true">
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT DISTINCT A.VOUCHER_NO,A.DT_CASHFLOW,
TO_CHAR(A.AMT_FINAL,'99,99,99,99,990.00') AMT_FINAL,A.TDS,
TO_CHAR(A.AMT_ADJUST,'99,99,99,99,990.00') AMT_ADJUST,
TO_CHAR(A.AMT_NET,'99,99,99,99,990.00') AMT_NET,
TO_CHAR(A.AMT_ADVANCE,'99,99,99,99,990.00') AMT_ADVANCE,
TO_CHAR(A.AMT_PARTIAL,'99,99,99,99,990.00') AMT_PARTIAL,
A.EXPENSE_DESC,A.EXPENSE_CHARGE,A.ALLOCATION_PERIOD,
DECODE(B.ALLOCATION_ID,'7','(Quarterly AUM)',
'8',(SELECT (TO_CHAR(A.FROM_DT,'Mon-YYYY')||' - '||TO_CHAR(A.TO_DT,'Mon-YYYY')) ALLOCDT FROM DATA_AVG_AUM A, DATA_TRAN_BILL B
WHERE A.TRAN_ID = B.TRAN_ID
AND B.VOUCHER_NO='<%=voucher%>')) QTRAUM
FROM VW_VOUCHER_DETAIL A, DATA_TRAN_BILL B , MAST_ALLOCATION C
WHERE A.VOUCHER_NO = B.VOUCHER_NO
AND B.ALLOCATION_ID = C.ID
AND A.VOUCHER_NO='<%=voucher%>'
</sql:query>
<sql:resultSet id="rs">
<b>Approval Memo</b><br><br>
<table width="793" border="0" cellspacing="0" cellpadding="0" style="border: 1px solid #6e6e6e;">
<tr>
<td colspan="4" valign="TOP" align="center">
<%--------------------------%>
<table width="98%" border="0" cellspacing="0" cellpadding="0" >
<tr bgcolor="#c5c5c5" style="height:20px">
<td width="10"> </td>
<td width="200" nowrap><b>Vocuher No.</b></td>
<td width="10">:</td>
<td width="0" colspan="5"><sql:getColumn colName="VOUCHER_NO"/></td>
</tr>
<tr>
<td> </td>
<td><b>Allocation Period</b></td>
<td>:</td>
<td><sql:getColumn colName="ALLOCATION_PERIOD"/> <sql:getColumn colName="QTRAUM"/></td>
<td> </td>
<td><b>Expense Type</b></td>
<td>:</td>
<td><sql:getColumn colName="EXPENSE_DESC"/></td>
</tr>
<tr>
<td> </td>
<td><b>Cash Flow Date</b></td>
<td>:</td>
<td><sql:getColumn colName="DT_CASHFLOW"/></td>
<td> </td>
<td><b>Expense Charge To</b></td>
<td>:</td>
<td><sql:getColumn colName="EXPENSE_CHARGE"/></td>
</tr>
<tr>
<td> </td>
<td><b>Gross Amount</b></td>
<td>:</td>
<td><sql:getColumn colName="AMT_FINAL"/></td>
</tr>
<tr>
<%-- <td> </td>
<td><b>Gross Amount</b></td>
<td>:</td>
<td><sql:getColumn colName="AMT_FINAL"/></td>
--%>
<td> </td>
<td><b>TDS (%)</b></td>
<td>:</td>
<td><sql:getColumn colName="TDS"/>%</td>
</tr>
<tr>
<td> </td>
<td><b>Adjusted Amount</b></td>
<td>:</td>
<td><sql:getColumn colName="AMT_ADJUST"/></td>
</tr>
<tr>
<td> </td>
<td><b>Advance/Partial</b></td>
<td>:</td>
<td><sql:getColumn colName="AMT_ADVANCE"/> / <sql:getColumn colName="AMT_PARTIAL"/></td>
<%-- <td> </td>
<td><b>Net Payable</b></td>
<td>:</td>
<td><sql:getColumn colName="AMT_NET"/></td> --%>
</tr>
<tr>
<td> </td>
<td><b>Net Payable</b></td>
<td>:</td>
<td><b><sql:getColumn colName="AMT_NET"/></b></td>
</tr>
<tr>
<td colspan="4"> </td>
</tr>
<tr>
<td> </td>
<td><b>Narration</b></td>
<td>:</td>
<td colspan="5">
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT PAYMENT_REMARKS FROM DATA_TRAN_BILL
WHERE VOUCHER_NO='<%=voucher%>'
</sql:query>
<sql:resultSet id="rs">
<sql:getColumn colName="PAYMENT_REMARKS"/>
</sql:resultSet>
</sql:preparedStatement>
</td>
</tr>
<!-- <tr>
<td colspan="4"> </td>
</tr>-->
<tr>
<td> </td>
<td><b>Scheme Allocation</b></td>
<td>:</td>
<td> </td>
</tr>
</table>
<%--------------------------%>
</td>
</tr>
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT A.BANK_NAME,B.SCHEME_NAME SCHEME_DESC,
TO_CHAR(SUM(B.GROSS),'99,99,99,99,990.00') GROSS,
round(SUM(B.TDS),0) TDS,
TO_CHAR(SUM(B.ADVANCE),'99,99,99,99,990.00') ADVANCE,
TO_CHAR(SUM(B.PARTIAL),'99,99,99,99,990.00') PARTIAL,
TO_CHAR(SUM(B.NET),'99,99,99,99,990.00') NET
FROM VW_VOUCHER_ALLOCATION_DETAIL B, VW_SCHEME_ACCOUNT A
WHERE B.VOUCHER_NO='<%=voucher%>'
AND B.ID = A.EXPENSE_SCH_CODE
AND (B.GROSS>0 OR B.ADVANCE>0 OR B.PARTIAL>0)
GROUP BY A.BANK_NAME,B.SCHEME_NAME
ORDER BY A.BANK_NAME, B.SCHEME_NAME
</sql:query>
<tr>
<td colspan="4" align="center">
<%--------------------------%>
<DIV STYLE="height: 510px;" ID="fix">
<table width="750" border="0" cellspacing="1" cellpadding="0" style="border: 1px solid #6e6e6e;">
<tr bgcolor="#c5c5c5" style="height:20px;">
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Custody Name</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Scheme Name</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Gross</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>TDS</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Advance</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Partial</B></td>
<td CLASS="BORDER_" style="border-bottom: 1px solid #6e6e6e;"><B>Net</B></td>
</tr>
<sql:resultSet id="rs">
<tr style="height:20px">
<td CLASS="BORDER_"><b><sql:getColumn colName="BANK_NAME"/></b></td>
<td CLASS="BORDER_" ><sql:getColumn colName="SCHEME_DESC"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="GROSS"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="TDS"/></td>
<td CLASS="BORDER_" align="right" bgcolor="#e2d36d"><sql:getColumn colName="ADVANCE"/></td>
<td CLASS="BORDER_" align="right" bgcolor="#e2d36d"><sql:getColumn colName="PARTIAL"/></td>
<td CLASS="BORDER_" align="right"><sql:getColumn colName="NET"/></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
<%
for(int index=0;index<BankName_list.size();index++){
System.out.println("BankName_list "+BankName_list.get(index));
}
%>
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT TO_CHAR(SUM(B.GROSS),'99,99,99,99,990.00') GROSS,
TO_CHAR(SUM(B.TDS),'99,99,99,99,990.00') TDS,
TO_CHAR(SUM(B.ADVANCE),'99,99,99,99,990.00') ADVANCE,
TO_CHAR(SUM(B.PARTIAL),'99,99,99,99,990.00') PARTIAL,
TO_CHAR(SUM(B.NET),'99,99,99,99,990.00') NET
FROM VW_VOUCHER_ALLOCATION_DETAIL B
WHERE B.VOUCHER_NO='<%=voucher%>'
AND (B.GROSS>0 OR B.ADVANCE>0 OR B.PARTIAL>0)
</sql:query>
<sql:resultSet id="rs">
<tr style="height:20px">
<td CLASS="BORDER_"> </td>
<td CLASS="BORDER_" align="right"><b>Grand Total </b></td>
<td CLASS="BORDER_" align="right"><b><sql:getColumn colName="GROSS"/></b></td>
<td CLASS="BORDER_" align="right"><b><sql:getColumn colName="TDS"/></b></td>
<td CLASS="BORDER_" align="right"><b><sql:getColumn colName="ADVANCE"/></b></td>
<td CLASS="BORDER_" align="right"><b><sql:getColumn colName="PARTIAL"/></b></td>
<td CLASS="BORDER_" align="right"><b><sql:getColumn colName="NET"/></b></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
<tr style="height:20px">
<td CLASS="BORDER_"> </td>
<td CLASS="BORDER_" align="right" colspan="2"><b>Adjusted Amount </b></td>
<td CLASS="BORDER_" colspan="5" align="right"><sql:getColumn colName="AMT_ADJUST"/></td>
</tr>
<tr style="height:20px" bgcolor="#c5c5c5">
<td CLASS="BORDER_"> </td>
<td CLASS="BORDER_" align="right" colspan="2"><b>Net Payable Amount </b></td>
<td CLASS="BORDER_" colspan="5" align="right"><b><sql:getColumn colName="AMT_NET"/></b></td>
</tr>
</sql:resultSet>
</sql:preparedStatement>
</table>
</DIV>
<%--------------------------%>
</td>
</tr>
<TFOOT>
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT DECODE(CNT,1,
C.MAP_1 || ' ' ||
B.VENDOR_NAME,
' '
) DESCR
FROM
(
SELECT A.VOUCHER_NO,COUNT(DISTINCT(VENDOR_ID)) CNT,MAX(A.VENDOR_ID) VENDOR_ID,MAX(A.PAYMENT_MODE) PAYMENT_MODE
FROM DATA_TRAN_BILL A
GROUP BY A.VOUCHER_NO
) A,MAST_VENDOR B,MAST_PAYMENT_MODE C
WHERE A.VENDOR_ID=B.ID
AND A.PAYMENT_MODE=C.ID
AND A.VOUCHER_NO='<%=voucher%>'
</sql:query>
<sql:resultSet id="rs">
<TR>
<TD colspan="3" STYLE="font-size: 13px; "> <sql:getColumn colName="DESCR"/></TD>
</sql:resultSet>
</sql:preparedStatement>
<TD STYLE="font-size: 10px; ">
<DIV STYLE="height:60px; " ID="fix">
<sql:preparedStatement id="pst" conn="conn">
<sql:query>
SELECT DISTINCT V.BANK_NAME,V.ACC_NO,C.DESCR,V.IFSC_NEFT
FROM DATA_TRAN_BILL A,MAST_PAYMENT_MODE C, MAST_VENDOR V
WHERE A.PAYMENT_MODE = C.ID
AND A.VENDOR_ID = V.ID
AND C.DESCR IN ('NEFT','RTGS','RTGS/NEFT')
AND A.VOUCHER_NO = '<%=voucher%>'
</sql:query>
<sql:resultSet id="rs">
<table align="right" border="0" width="70%">
<tr>
<td>Bank Name : </td>
<td><sql:getColumn colName="BANK_NAME"/> </td>
</tr>
<tr>
<td>Account No. : </td>
<td><sql:getColumn colName="ACC_NO"/> </td>
</tr>
<tr>
<td><sql:getColumn colName="DESCR"/> Code : </td>
<td><sql:getColumn colName="IFSC_NEFT"/> </td>
</tr>
</table>
</sql:resultSet>
</sql:preparedStatement>
</DIV>
</TD>
</TR>
</TFOOT>
</table>
<br><br><br>
<table width="793" border="0" cellspacing="0" cellpadding="0">
<tr style="height:15px">
<td colspan="5"> </td>
</tr>
<tr align="center">
<td width="30"> </td>
<td width="153" style="border-top: 1px solid #6e6e6e;">Maker</td>
<td width="500"> </td>
<td width="153" style="border-top: 1px solid #6e6e6e;">Checker</td>
<td width="500"></td>
<td width="153" style="border-top: 1px solid #6e6e6e;">Approver</td>
<td width="30"> </td>
</tr>
</table><BR>
</DIV>
<BR>
</center>
<sql:closeConnection conn="conn"/>
The method println(boolean) in the type PrintStream is not applicable for the arguments
<sql:getColumn colName="SCHEME_DESC"/> is coming as empty here
There in no method is avaialable println with 0-arguments.
It seems you have mixed script lets and jstl tags together.
System.out.println( %><sql:getColumn colName="SCHEME_DESC"/><% ..

code too large for try block

Eclipse compiles and runs this jsp just fine but when I deploy to Sun One 6.1 I get "Code too large for try { "
I'm trying to loop over a list of beans while performing aggregate summaries. Any suggestions on how to refactor this to get it to work on our outdated server?
<c:set var="ahJan" value="20" scope="request" />
<c:set var="ahTot" value="246" scope="request" />
<table border="0" width="95%" cellspacing="0" cellpadding="0" class="tableBlackBorder">
<tr>
<td>
<table width="100%" border="0" cellpadding="1" class="tableInternalBorder" id="sortable">
<tr>
<td class="tl">Source</td>
<td class="tl">Program</td>
<td class="tl">Project</td>
<td class="tl">Contract</td>
<td class="tl">Line Code</td>
<td class="tl">Jan</td>
<td class="tl">Total</td>
</tr>
<c:set var="prevProgram" value="" scope="request" />
<c:set var="prevProject" value="" scope="request" />
<c:set var="prevContract" value="" scope="request" />
<c:set var="prevLinecode" value="" scope="request" />
<c:set var="prevBusArea" value="" scope="request" />
<c:set var="ctc_totSub" value="" scope="request" />
<c:set var="plan_totSub" value="" scope="request" />
<c:forEach var="gap" items="${list}" varStatus="status">
<c:if test="${status.first}">
<tr>
<td class="o" NOWRAP>Plan</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.pjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.plineSum}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>CTC</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctcjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctclineSum}" /></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<c:set var="deltaJan" value="${gap.pjan-gap.ctcjan}" />
<c:set var="deltaSubTotal" value="${gap.plineSum-gap.ctclineSum}" />
<c:set var="programDeltaJan" value="${deltaJan}" />
<c:set var="programDeltaSubTotal" value="${deltaSubTotal}" />
<c:set var="planProgramSubTot" value="${gap.plineSum}" />
<c:set var="ctcProgramSubTot" value="${gap.ctclineSum}" />
<tr>
<td class="o" NOWRAP>Delta Hrs</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaJan}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaSubTotal}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>Delta Heads</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan/(ahJan*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaJan/(ahJan*8)}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal/(ahTot*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaSubTotal/(ahTot*8)}" /></td>
</tr>
</c:if>
<c:if test="${gap.program_name == prevProgram}" >
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<tr>
<td class="o" NOWRAP>Plan</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.pjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.plineSum}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>CTC</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctcjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctclineSum}" /></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<c:set var="deltaJan" value="${gap.pjan-gap.ctcjan}" />
<c:set var="deltaSubTotal" value="${gap.plineSum-gap.ctclineSum}" />
<c:set var="programDeltaJan" value="${programDeltaJan+deltaJan}" />
<c:set var="programDeltaSubTotal" value="${programDeltaSubTotal+deltaSubTotal}" />
<c:set var="planProgramSubTot" value="${planProgramSubTot+gap.plineSum}" />
<c:set var="ctcProgramSubTot" value="${ctcProgramSubTot+gap.ctclineSum}" />
<tr>
<td class="o" NOWRAP>Delta Hours</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaJan}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaSubTotal}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>Delta Heads</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan/(ahJan*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaJan/(ahJan*8)}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal/(ahTot*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaSubTotal/(ahTot*8)}" /></td>
</tr>
</c:if>
<c:if test="${gap.program_name != prevProgram && !status.first}" >
<tr>
<td class="CTCProgramSummary" colspan="5">Gap Summary for Program: <c:out value="${prevProgram}" /></td>
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>programDeltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${programDeltaJan}" /></td>
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>programDeltaDec}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${programDeltaDec}" /></td>
<c:set var="delta" value="${planProgramSubTot-ctcProgramSubTot}" />
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>delta}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${delta}" /></td>
<c:set var="BusAreaDeltaJan" value="${BusAreaDeltaJan+programDeltaJan}" />
<c:set var="BusAreaDeltaSubTotal" value="${BusAreaDeltaSubTotal+programDeltaSubTotal}" />
<c:set var="planBusAreaSubTot" value="${planBusAreaSubTot+planProgramSubTot}" />
<c:set var="ctcBusAreaSubTot" value="${ctcBusAreaSubTot+ctcProgramSubTot}" />
<c:set var="programDeltaJan" value="" />
<c:set var="programDeltaSubTotal" value="" />
<c:set var="planProgramSubTot" value="" />
<c:set var="ctcProgramSubTot" value="" />
</tr>
<c:if test="${gap.business_area == prevBusArea}" >
<tr>
<td class="o" NOWRAP>Plan</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.pjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.plineSum}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>CTC</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctcjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctclineSum}" /></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<c:set var="deltaJan" value="${gap.pjan-gap.ctcjan}" />
<c:set var="deltaSubTotal" value="${gap.plineSum-gap.ctclineSum}" />
<c:set var="programDeltaJan" value="${programDeltaJan+deltaJan}" />
<c:set var="programDeltaSubTotal" value="${programDeltaSubTotal+deltaSubTotal}" />
<c:set var="planProgramSubTot" value="${planProgramSubTot+gap.plineSum}" />
<c:set var="ctcProgramSubTot" value="${ctcProgramSubTot+gap.ctclineSum}" />
<tr>
<td class="o" NOWRAP>Delta Hours</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaJan}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaSubTotal}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>Delta Heads</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan/(ahJan*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaJan/(ahJan*8)}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal/(ahTot*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaSubTotal/(ahTot*8)}" /></td>
</tr>
</c:if>
<c:if test="${gap.business_area != prevBusArea && !status.first}" >
<tr>
<td class="CTCBusAreaSummary" colspan="5">Gap Summary for Business Area: <c:out value="${prevBusArea}" /></td>
<td class="CTCBusAreaSummary" style="background-color: <c:if test='${0>BusAreaDeltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${BusAreaDeltaJan}" /></td>
<c:set var="delta" value="${planBusAreaSubTot-ctcBusAreaSubTot}" />
<td class="CTCBusAreaSummary" style="background-color: <c:if test='${0>delta}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${delta}" /></td>
<c:set var="totalDeltaJan" value="${totalDeltaJan+BusAreaDeltaJan}" />
<c:set var="totalDeltaSubTotal" value="${totalDeltaSubTotal+BusAreaDeltaSubTotal}" />
<c:set var="planTotal" value="${planTotal + planBusAreaSubTot}" />
<c:set var="ctcTotal" value="${ctcTotal + ctcBusAreaSubTot}" />
<c:set var="BusAreaDeltaJan" value="" />
<c:set var="BusAreaDeltaSubTotal" value="" />
<c:set var="planBusAreaSubTot" value="" />
<c:set var="ctcBusAreaSubTot" value="" />
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<tr>
<td class="o" NOWRAP>Plan</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.pjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.plineSum}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>CTC</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctcjan}" /></td>
<td class="oRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap.ctclineSum}" /></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<c:set var="deltaJan" value="${gap.pjan-gap.ctcjan}" />
<c:set var="deltaSubTotal" value="${gap.plineSum-gap.ctclineSum}" />
<c:set var="planProgramSubTot" value="${planProgramSubTot+gap.plineSum}" />
<c:set var="ctcProgramSubTot" value="${ctcProgramSubTot+gap.ctclineSum}" />
<tr>
<td class="o" NOWRAP>Delta Hours</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaJan}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${deltaSubTotal}" /></td>
</tr>
<tr>
<td class="o" NOWRAP>Delta Heads</td>
<td class="o" NOWRAP><c:out value="${gap.program_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.project_name}" /></td>
<td class="o" NOWRAP><c:out value="${gap.contract}" /></td>
<td class="oLeft"><c:out value="${gap.linecode}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaJan/(ahJan*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaJan/(ahJan*8)}" /></td>
<td class="oRight" style="background-color: <c:if test='${0>deltaSubTotal/(ahTot*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${deltaSubTotal/(ahTot*8)}" /></td>
</tr>
<c:set var="programDeltaJan" value="${programDeltaJan+deltaJan}" />
<c:set var="programDeltaSubTotal" value="${programDeltaSubTotal+deltaSubTotal}" />
</c:if>
</c:if>
<c:set var="prevLinecode" value="${gap.linecode}" />
<c:set var="prevContract" value="${gap.contract}" />
<c:set var="prevProgram" value="${gap.program_name}" />
<c:set var="prevProject" value="${gap.project_name}" />
<c:set var="prevBusArea" value="${gap.business_area}" />
<c:if test="${status.last}" >
<tr>
<td class="CTCProgramSummary" colspan="5">Gap Summary for Program: <c:out value="${prevProgram}" /></td>
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>programDeltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${programDeltaJan}" /></td>
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>programDeltaDec}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${programDeltaDec}" /></td>
<c:set var="delta" value="${planProgramSubTot-ctcProgramSubTot}" />
<td class="CTCProgramSummary" style="background-color: <c:if test='${0>delta}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${delta}" /></td>
<c:set var="BusAreaDeltaJan" value="${BusAreaDeltaJan+programDeltaJan}" />
<c:set var="planBusAreaSubTot" value="${planBusAreaSubTot+planProgramSubTot}" />
<c:set var="ctcBusAreaSubTot" value="${ctcBusAreaSubTot+ctcProgramSubTot}" />
<c:set var="planProgramSubTot" value="" />
<c:set var="ctcProgramSubTot" value="" />
</tr>
<tr>
<td class="CTCBusAreaSummary" colspan="5">Gap Summary for Business Area: <c:out value="${prevBusArea}" /></td>
<td class="CTCBusAreaSummary" style="background-color: <c:if test='${0>BusAreaDeltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${BusAreaDeltaJan}" /></td>
<c:set var="delta" value="${planBusAreaSubTot-ctcBusAreaSubTot}" />
<td class="CTCBusAreaSummary" style="background-color: <c:if test='${0>delta}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${delta}" /></td>
<c:set var="totalDeltaJan" value="${totalDeltaJan+BusAreaDeltaJan}" />
<c:set var="planTotal" value="${planTotal + planBusAreaSubTot}" />
<c:set var="ctcTotal" value="${ctcTotal + ctcBusAreaSubTot}" />
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
<tr>
<td colspan="18" class="TableRowBGSubNav"></td>
</tr>
</c:if>
</c:forEach>
<tr>
<td colspan="5" class="CTCTotalSummary">TOTAL Gap Summary Hours:</td>
<td class="CTCTotalSummary" style="background-color: <c:if test='${0>totalDeltaJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${totalDeltaJan}" /></td>
<c:set var="delta" value="${planTotal-ctcTotal}" />
<td class="CTCTotalSummary" style="background-color: <c:if test='${0>delta}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${delta}" /></td>
</tr>
<tr>
<td colspan="5" class="CTCTotalSummary">TOTAL Gap Summary Heads:</td>
<td class="CTCTotalSummary" style="background-color: <c:if test='${0>totalDeltaJan/(ahJan*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${totalDeltaJan/(ahJan*8)}" /></td>
<c:set var="delta" value="${planTotal-ctcTotal}" />
<td class="CTCTotalSummary" style="background-color: <c:if test='${0>delta/(ahTot*8)}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${delta/(ahTot*8)}" /></td>
</tr>
<tr>
<td colspan="5" class="CTCTotalSummary">Accounting Hour Summary </td>
<td class="CTCTotalSummary" style="background-color: <c:if test='${0>ahJan}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${ahJan}" /></td>
<c:set var="delta" value="${planTotal-ctcTotal}" />
<td class="CTCTotalSummary" style="background-color: <c:if test='${ahTot}'>#FF0000</c:if>" ><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="1" value="${ahTot}" /></td>
</tr>
</table>
</td>
</tr>
</table>
EDIT:
Tried using forTokes as such:
<c:forTokens
items="ctcjan, ctcfeb, ctcmar, ctcapr, ctcmay, ctcjun, ctcjul, ctcaug, ctcsep, ctcoct, ctcnov, ctcdec, ctclineSum"
delims=", " var="curField">
<td class="TableOutputTextRight"><fmt:formatNumber type="number" minIntegerDigits="1" maxFractionDigits="0" value="${gap[curField]}" /></td>
</c:forTokens>
Still Too Large. Any other trimming-down ideas?
EDIT:
So basically my fix was to remove a lot of the aggregate details. I've put in an IT request to get Glassfish or JBoss. I've been read about JSF and it looks awesome!
The size limit in Java for a method is 65535 characters. You need to refactor that code. This website here has a solution. From the Java Spec:
The length of field and method names, field and method descriptors,
and other constant string values is limited to 65535 characters by the
16-bit unsigned length item of the CONSTANT_Utf8_info structure
(ยง4.4.7). Note that the limit is on the number of bytes in the
encoding and not on the number of encoded characters. UTF-8 encodes
some characters using two or three bytes. Thus, strings incorporating
multibyte characters are further constrained.
Apparently, this is common with dynamically generated JSP.
And, since you may be blocked at work - here is the recommended solution from that site:
Help your container modularize the code. Try splitting the JSP into
several chunks and make dynamic includes instead of static ones.
Dynamic includes (jsp:include against %#include) will compile the JSP
and then stream the output instead of trying to include all the code
into one big method or try catch block.

Categories