-1

我想从 SQL JSTL tags 打印结果集值 retrive。但它给出了错误 org.apache.jasper.JasperException: Unable to compile class for JSP:

在 jsp 文件中的第 219 行发生错误:/testVoucher.jsp PrintStream 类型中的方法 println(boolean) 不适用于参数 (void) 216: 217:
218: <% 219: System.out.println ( 220: %> 221: 222: <%

在 jsp 文件中的第 220 行出现错误:/testVoucher.jsp 语法错误,插入 ")" 以完成表达式 217:
218: <% 219: System.out.println( 220: %> 221: 222: <% 223:);

在 jsp 文件中的第 223 行发生错误:/testVoucher.jsp 令牌“)”上的语法错误,删除此令牌 220: %> 221: 222: <% 223: ); 224: %> 225:
226:

堆栈跟踪: 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)

主要部分代码如下

<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>  

整个代码如下:

<%@ 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">&nbsp;</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>&nbsp;</td>
                  <td><b>Allocation Period</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="ALLOCATION_PERIOD"/>&nbsp;<sql:getColumn colName="QTRAUM"/></td>

                  <td>&nbsp;</td>
                  <td><b>Expense Type</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="EXPENSE_DESC"/></td>

                </tr>
                <tr>
                  <td>&nbsp;</td>
                  <td><b>Cash Flow Date</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="DT_CASHFLOW"/></td>

                  <td>&nbsp;</td>
                  <td><b>Expense Charge To</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="EXPENSE_CHARGE"/></td>
                </tr>               
               <tr>
                  <td>&nbsp;</td>
                  <td><b>Gross Amount</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="AMT_FINAL"/></td>
                </tr>   

                <tr>
               <%--   <td>&nbsp;</td>
                  <td><b>Gross Amount</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="AMT_FINAL"/></td>
               --%>
                  <td>&nbsp;</td>
                  <td><b>TDS (%)</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="TDS"/>%</td>
                </tr>

                <tr>
                  <td>&nbsp;</td>
                  <td><b>Adjusted Amount</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="AMT_ADJUST"/></td>
                </tr>   

                <tr>
                  <td>&nbsp;</td>
                  <td><b>Advance/Partial</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="AMT_ADVANCE"/> / <sql:getColumn colName="AMT_PARTIAL"/></td>
                <%--  <td>&nbsp;</td>
                  <td><b>Net Payable</b></td>
                  <td>:</td>
                  <td><sql:getColumn colName="AMT_NET"/></td> --%>
                </tr>

                <tr>
                  <td>&nbsp;</td>
                  <td><b>Net Payable</b></td>
                  <td>:</td>
                  <td><b><sql:getColumn colName="AMT_NET"/></b></td>
                </tr>                 


               <tr>
                  <td colspan="4">&nbsp;</td>
                </tr>   

               <tr>
                  <td>&nbsp;</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">&nbsp;</td>
                </tr>-->
                <tr>
                  <td>&nbsp;</td>
                  <td><b>Scheme Allocation</b></td>
                  <td>:</td>
                  <td>&nbsp;</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_">&nbsp;</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_">&nbsp;</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_">&nbsp;</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; ">&nbsp;&nbsp;<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">&nbsp;</td>
    </tr>       
    <tr align="center">
      <td width="30">&nbsp;</td>
      <td width="153" style="border-top: 1px solid #6e6e6e;">Maker</td>
      <td width="500">&nbsp;</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">&nbsp;</td>      
    </tr>

   </table><BR>
   </DIV>  
   <BR>
</center>
<sql:closeConnection conn="conn"/>
4

2 回答 2

2

PrintStream 类型中的方法 println(boolean) 不适用于参数

<sql:getColumn colName="SCHEME_DESC"/>这里空无一人

没有任何方法可以使用带有 0 参数的 println。

于 2013-03-25T10:18:03.120 回答
0

似乎您将脚本让和 jstl 标记混合在一起。

System.out.println( %><sql:getColumn colName="SCHEME_DESC"/><% ..

于 2013-03-25T10:26:56.877 回答