问题描述
页面提示错误如下:HTTPStatus500---------------------------------------------------------------------------------typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionorg.apache.jasper.JasperException:UnabletocompileclassforJSPAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"<",(expectedAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerror,insert")"tocompleteExpressionAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"<",(expectedAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"(",invalidExpressionAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"<",(expectedAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerror,insert")"tocompleteExpressionAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"<",(expectedAnerroroccurredatline:24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"(",invalidExpressionorg.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:397)org.apache.jasper.compiler.Compiler.compile(Compiler.java:288)org.apache.jasper.compiler.Compiler.compile(Compiler.java:267)org.apache.jasper.compiler.Compiler.compile(Compiler.java:255)org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:556)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:293)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)javax.servlet.http.HttpServlet.service(HttpServlet.java:802)noteThefullstacktraceoftherootcauseisavailableintheApacheTomcat/5.5.9logs./*********************************************************************************************************************************/程序代码如下:<%@pageinfo="faa013t_s.jsp"%><%@pageimport="java.sql.*"%><%@pageimport="java.lang.*"%><%@includefile="../inc/Session.inc"%><%@includefile="../inc/checklogin.jsp"%><%@includefile="../inc/dbcon.inc"%><%@pageimport="com.ysusoft.util.db.DBUtil"%><%@pageimport="com.ysusoft.util.db.DBConn"%><%@pagecontentType="text/html;charset=gb2312"%><%@pageimport="com.ysusoft.util.common.commonUtil"%><%@pageimport="com.ysusoft.util.common.getSearchCond"%><%@pageimport="java.util.Hashtable"%><%Statementstmt1=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);Stringsql="";Stringsqlstr="";Stringppdm_grd="";Stringppdm_act="";Stringprsn_cd="";Stringprsn_name="";Stringdept_cd="";Stringold_group_pay="";Stringold_group_pname="";Stringgroup_pay1="";Stringgroup_pname1="";Stringdir_id=request.getParameter("dir_id");//out.print(dir_id);Stringgroup_pay="";Stringgroup_pname="";Stringstrsql="";strsql=strsql+"SELECTprsn_cd,";strsql=strsql+"dept_cd,";strsql=strsql+"prsn_name,";strsql=strsql+"(SELECTCOUNT(*)FROMgroup01t(nolock)WHEREprsn_cd=paa010t.prsn_cdANDgroup_id='"+dir_id+"')";strsql=strsql+"FROMpaa010t(nolock)";strsql=strsql+"WHERE1=1";strsql=strsql+"ORDERBYprsn_cd";ResultSetrs1=stmt.executeQuery(strsql);Hashtable<String,String>pay_numbers=newHashtable<String,String>();Hashtable<String,String>del_pay_numbers=newHashtable<String,String>();while(rs1.next()){prsn_cd=rs1.getString(1);dept_cd=rs1.getString(2);prsn_name=rs1.getString(3);ppdm_grd=request.getParameter("d"+dept_cd+"p"+prsn_cd);if(ppdm_grd==null){}elseif(ppdm_grd.equals("N")){del_pay_numbers.put(prsn_cd,prsn_name);}else{if(ppdm_grd.equals("Y")){group_pay=group_pay+prsn_cd+",";group_pname=group_pname+prsn_name+",";pay_numbers.put(prsn_cd,prsn_name);}}}%><%Stringstrsql_s="";strsql_s=strsql_s+"selectgroup_pay,group_pnamefromgroup01twheregroup_id=";strsql_s=strsql_s+"'"+dir_id+"'";System.out.println(strsql_s);ResultSetrs=stmt.executeQuery(strsql_s);rs.next();old_group_pay=rs.getString(1);old_group_pname=rs.getString(2);String[]old_group_pays=old_group_pay.split(",");String[]old_group_pnames=old_group_pname.split(",");old_group_pay="";old_group_pname="";for(inti=0;i<old_group_pays.length;i++){if(!pay_numbers.containsKey(old_group_pays[i].trim())&&!del_pay_numbers.containsKey(old_group_pays[i].trim())){//pay_numbers.put(old_group_pays[i].trim(),old_group_pnames[i].trim());old_group_pay+=old_group_pays[i].trim()+",";old_group_pname+=old_group_pnames[i].trim()+",";out.print(old_group_pay);}}group_pay=group_pay+old_group_pay;group_pname=group_pname+old_group_pname;if(group_pay.length()>0){group_pay=group_pay.substring(0,group_pay.length()-1);group_pname=group_pname.substring(0,group_pname.length()-1);}//out.println(group_pay);//out.println(group_pname);//group_pay1=old_group_pay+group_pay;//group_pname1=old_group_pname+group_pname;sql="updategroup01tsetgroup_pay='"+group_pay+"',group_pname='"+group_pname+"'wheregroup_id='"+dir_id+"'";stmt.executeUpdate(sql);rs1.close();conn.close();%><scriptLanguage="JavaScript">/*alert("权限保存成功!");window.parent.rhead.b_search();*/</script>
解决方案
解决方案二:
这么长的一大篇,看起来累死了而且还没有格式
解决方案三:
不好意思,让大家受累了。但我真想解决这个问题
解决方案四:
qzsz013t_s.jsp是什么页面?是你的引入页面吗?
解决方案五:
是的,是我引入的,是不该引入吗
解决方案六:
引入的这个界面是没有用的
解决方案七:
24inthejspfile:/filedir/qzsz013t_s.jspGeneratedservleterror:Syntaxerrorontoken"<",(expected24行有错误,少了个"<"括号吧,楼主在24行加一下吧!
解决方案八:
引用5楼whyfine0825521的回复:
引入的这个界面是没有用的
把这个引入去掉试下,如果再不行的话,把代码贴上来
解决方案九:
没看到少“<”符号啊
解决方案十:
我把引入的去掉试试
解决方案十一:
引用的去掉了还是不行代码如下:<%@pageimport="java.sql.*"%><%@pageimport="java.lang.*"%><%@includefile="../inc/Session.inc"%><%@includefile="../inc/checklogin.jsp"%><%@includefile="../inc/dbcon.inc"%><%@pageimport="com.ysusoft.util.db.DBUtil"%><%@pageimport="com.ysusoft.util.db.DBConn"%><%@pagecontentType="text/html;charset=gb2312"%><%@pageimport="com.ysusoft.util.common.commonUtil"%><%@pageimport="com.ysusoft.util.common.getSearchCond"%><%@pageimport="java.util.Hashtable"%><%Statementstmt1=conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_UPDATABLE);Stringsql="";Stringsqlstr="";Stringppdm_grd="";Stringppdm_act="";Stringprsn_cd="";Stringprsn_name="";Stringdept_cd="";Stringold_group_pay="";Stringold_group_pname="";Stringgroup_pay1="";Stringgroup_pname1="";Stringdir_id=request.getParameter("dir_id");//out.print(dir_id);Stringgroup_pay="";Stringgroup_pname="";Stringstrsql="";strsql=strsql+"SELECTprsn_cd,";strsql=strsql+"dept_cd,";strsql=strsql+"prsn_name,";strsql=strsql+"(SELECTCOUNT(*)FROMgroup01t(nolock)WHEREprsn_cd=paa010t.prsn_cdANDgroup_id='"+dir_id+"')";strsql=strsql+"FROMpaa010t(nolock)";strsql=strsql+"WHERE1=1";strsql=strsql+"ORDERBYprsn_cd";ResultSetrs1=stmt.executeQuery(strsql);Hashtable<String,String>pay_numbers=newHashtable<String,String>();Hashtable<String,String>del_pay_numbers=newHashtable<String,String>();while(rs1.next()){prsn_cd=rs1.getString(1);dept_cd=rs1.getString(2);prsn_name=rs1.getString(3);ppdm_grd=request.getParameter("d"+dept_cd+"p"+prsn_cd);if(ppdm_grd==null){}elseif(ppdm_grd.equals("N")){del_pay_numbers.put(prsn_cd,prsn_name);}else{if(ppdm_grd.equals("Y")){group_pay=group_pay+prsn_cd+",";group_pname=group_pname+prsn_name+",";pay_numbers.put(prsn_cd,prsn_name);}}}%><%Stringstrsql_s="";strsql_s=strsql_s+"selectgroup_pay,group_pnamefromgroup01twheregroup_id=";strsql_s=strsql_s+"'"+dir_id+"'";System.out.println(strsql_s);ResultSetrs=stmt.executeQuery(strsql_s);rs.next();old_group_pay=rs.getString(1);old_group_pname=rs.getString(2);String[]old_group_pays=old_group_pay.split(",");String[]old_group_pnames=old_group_pname.split(",");old_group_pay="";old_group_pname="";for(inti=0;i<old_group_pays.length;i++){if(!pay_numbers.containsKey(old_group_pays[i].trim())&&!del_pay_numbers.containsKey(old_group_pays[i].trim())){//pay_numbers.put(old_group_pays[i].trim(),old_group_pnames[i].trim());old_group_pay+=old_group_pays[i].trim()+",";old_group_pname+=old_group_pnames[i].trim()+",";out.print(old_group_pay);}}group_pay=group_pay+old_group_pay;group_pname=group_pname+old_group_pname;if(group_pay.length()>0){group_pay=group_pay.substring(0,group_pay.length()-1);group_pname=group_pname.substring(0,group_pname.length()-1);}//out.println(group_pay);//out.println(group_pname);//group_pay1=old_group_pay+group_pay;//group_pname1=old_group_pname+group_pname;sql="updategroup01tsetgroup_pay='"+group_pay+"',group_pname='"+group_pname+"'wheregroup_id='"+dir_id+"'";stmt.executeUpdate(sql);rs1.close();conn.close();%><scriptLanguage="JavaScript">/*alert("权限保存成功!");window.parent.rhead.b_search();*/</script>
解决方案十二:
引入的页面的代码勒?
解决方案十三:
这个代码所在的页面就是qzsz013t_s.jsp我把<%@pageinfo="faa013t_s.jsp"%>去掉了
解决方案十四:
帮我的人哪里去了?
解决方案十五:
看错误提示啊,Syntaxerrorontoken"<",(expected
解决方案:
去看看jsp编译之后生成的java文件,在tomcat/webapps/work/目录下,出错是出在编译后生成的java文件的第24行,看看那里有什么错误
解决方案:
看错误提示啊,Syntaxerrorontoken"<",(expected这个程序在我本机就好用,放在服务器上就提示这个错误
解决方案:
代码看起来比较累。建议用屏蔽的方式check一下。折半屏蔽吧,这样比较快的找到哪行有问题。
解决方案:
Compilefailed;seethecompilererroroutputfordetails.atorg.apache.tools.ant.taskdefs.Javac.compile(Javac.java:844)atorg.apache.tools.ant.taskdefs.Javac.execute(Javac.java:682)atorg.apache.jasper.compiler.Compiler.generateClass(Compiler.java:320)atorg.apache.jasper.compiler.Compiler.compile(Compiler.java:370)atorg.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:473)atorg.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:190)atorg.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)atorg.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)atjavax.servlet.http.HttpServlet.service(HttpServlet.java:853)atorg.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)atorg.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)atorg.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:256)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)atorg.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)atorg.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)atorg.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)atorg.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)atorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)atorg.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)atorg.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)atorg.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)atorg.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)atorg.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:193)atorg.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)atorg.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)atorg.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:589)atorg.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:666)atjava.lang.Thread.run(Thread.java:479)我做JSP随机验证码时出现这个错误!请帮忙!
解决方案:
还是没有人解决这个问题,conghongbbs这位老兄不给解决问题也就算了,还在这里提问,太不厚道了!寻求高人指点!