不好意思,是这样的。直接把函数写在jsp页面里,然后调用。
public  void showcontent(int p){}
public void showpage(int totalnumber,int maxperpage,String filename){}这两个函数出错,出错信息
Compilation of 'E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java' failed:
--------------------------------------------------------------------------------
 E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:280: illegal start of expression
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 128:
public void showcontent(int p)E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:264: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 112:
if(currentpage==1){showcontent(maxperpage);showpage(totalput,maxperpage,"jhgl_zhjh");}E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:264: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 112:
if(currentpage==1){showcontent(maxperpage);showpage(totalput,maxperpage,"jhgl_zhjh");}E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:268: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 116:
showcontent(maxperpage);E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:269: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 117:
showpage(totalput,maxperpage,"jhgl_zhjh");E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:273: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 121:
showcontent(maxperpage);E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:274: cannot resolve symbol
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 122:
showpage(totalput,maxperpage,"jhgl_zhjh");
--------------------------------------------------------------------------------
Full compiler error(s):
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:280: illegal start of expression
      public  void showcontent(int p) //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 128]
      ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:264: cannot resolve symbol
symbol  : method showcontent (int)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
        if(currentpage==1){showcontent(maxperpage);showpage(totalput,maxperpage,"jhgl_zhjh");} //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 112]
                           ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:264: cannot resolve symbol
symbol  : method showpage (int,int,java.lang.String)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
        if(currentpage==1){showcontent(maxperpage);showpage(totalput,maxperpage,"jhgl_zhjh");} //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 112]
                                                   ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:268: cannot resolve symbol
symbol  : method showcontent (int)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
            showcontent(maxperpage); //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 116]
            ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:269: cannot resolve symbol
symbol  : method showpage (int,int,java.lang.String)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
            showpage(totalput,maxperpage,"jhgl_zhjh"); //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 117]
            ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:273: cannot resolve symbol
symbol  : method showcontent (int)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
            showcontent(maxperpage); //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 121]
            ^
E:\bea\bmwy\bmwy_domain\.\myserver\.wlnotdelete\extract\myserver_bmwyapp_bmwyapp\jsp_servlet\_bm_cqgd2006\__jhgl_zhjh.java:274: cannot resolve symbol
symbol  : method showpage (int,int,java.lang.String)
location: class jsp_servlet._bm_cqgd2006.__jhgl_zhjh
            showpage(totalput,maxperpage,"jhgl_zhjh"); //[ /bm_cqgd2006/jhgl_zhjh.jsp; Line: 122]
            ^
7 errors
--------------------------------------------------------------------------------
Fri Sep 22 16:24:09 CST 2006 jsp写函数是包在<%! %>里的,我的代码没写!,但是加了之后出错信息变了
如下
Parsing of JSP File '/bm_cqgd2006/jhgl_zhjh.jsp' failed:
--------------------------------------------------------------------------------
 /bm_cqgd2006/jhgl_zhjh.jsp(153): scriptlet close brace '}' unbalanced at line 153 which breaks scope '_base_service_scope_'
probably occurred due to an error in /bm_cqgd2006/jhgl_zhjh.jsp line 153:
}catch(Exception e){System.out.println(e);}} 
--------------------------------------------------------------------------------
Fri Sep 22 16:25:26 CST 2006

解决方案 »

  1.   

    提示的是很清楚嘛
    /bm_cqgd2006/jhgl_zhjh.jsp line 128有非法的表达式
      

  2.   

    就是调用两个函数出了问题,请问一下,jsp写函数是不是要用〈%! %〉包起来。我没加!所以出现那些问题,但是包了之后也不行,请问我的两个函数这样写可以吗?<%!
    public  void showcontent(int p)
    {
    int i=0;
    %>
    <tr> <td width="79%" height="20" class="news02">&nbsp; </td>
         <td width="21%" height="20" align="center" class=news02>&nbsp;</td>
    </tr>
    <tr >
    <td background="images/new-bg.gif" colspan="2" class="blank1" height="1"></td>
    </tr>
    <%
     while((rs.next())&&i<=p)
     {
     %>
       <tr>
       <td width="79%"height="32"lign="left"background="img/line00.gif">&nbsp;&nbsp;<span class="news02">&nbsp;&nbsp;<a href="jhgl_list.jsp?bh=<%=rs.getString("bh")%>" class="news02"><%=rs.getString("bt")%></a></span>
      </td>
       <td width="21%" align="center" class="news02"><%=rs.getString("rq")%></td>
        </tr>
    <% i=i+1;
    }
    %> 
    <tr> 
    <td height="25" colspan="2" class=news02 align=right>
    <%
    }
    %><%!public void showpage(int totalnumber,int maxperpage,String filename)
    { int n=0;
      if ((totalPut%maxperpage)==0) {n= totalPut/maxperpage ;}
          else n= totalPut/maxperpage+1 ;
    %> 
      <form method=Post action=<%=filename%>?page1=page.value>
     <%
     if(current<2){out.print("首页 上一页&nbsp;");}
     else 
     {
     %>
     <a href=<%=filename%>?page1="1" class=news02>首页</a>&nbsp
     <a href=<%=filename%>?page1=<%=Integer.toString(currentpage-1)%> class=news02>上一页</a>&nbsp;
    <%
    }if(n-currentpage<1){out.print("下一页 尾页");}else 
    {
    %>
    <a href=<%=filename%>?page1=<%=Integer.toString(currentpage+1)%> class=news02>下一页</a>&nbsp;
    <a href=<%=filename%>?page1=<%=Integer.toString(n)%> class=news02>尾页</a>&nbsp;&nbsp;页次:<strong><font color=red><%=CurrentPage%></font><%=n%></strong>
    <%
    }
    %> 转到:
    <select name='page' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
           <%for(int i = 1; i<n;i++)
           {
           %>
        <option value='<%=i%>' <%if (Integer.parseInt(Page1)==i){%> selected <%}%>><%=i%>/<%=n%></option>
                                    <% } %>
                                  </select>
                                  <%    } %>