求助:出现错误 The server encountered an internal error () that prevented it from fulfilling this request.

问题描述

Theserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionorg.apache.jasper.JasperException:UnabletocompileclassforJSP:Anerroroccurredatline:194inthegeneratedjavafileSyntaxerror,insert"elseStatement"tocompleteIfStatementAnerroroccurredatline:194inthegeneratedjavafileSyntaxerror,insert"}"tocompleteBlockAnerroroccurredatline:204inthegeneratedjavafileSyntaxerrorontoken"}",deletethistokenAnerroroccurredatline:205inthegeneratedjavafileSyntaxerror,insert"}"tocompleteClassBodyStacktrace: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:423)org.apache.jasper.compiler.Compiler.compile(Compiler.java:308)org.apache.jasper.compiler.Compiler.compile(Compiler.java:286)org.apache.jasper.compiler.Compiler.compile(Compiler.java:273)org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:566)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)javax.servlet.http.HttpServlet.service(HttpServlet.java:803)下面为源码:***************1queryStudent.jsp************<%@pagecontentType="text/html;charset=gb2312"language="java"import="java.sql.*,Bean.Student"errorPage="errorpage.jsp"%><%@pageimport="java.util.*;"%><%request.setCharacterEncoding("gb2312");Stringjudgement=request.getParameter("queryButton");ArrayListaList=null;Stringstu_id=null;if(judgement!=null){Studentstu=newStudent();stu_id=request.getParameter("stu_id");if(stu_id==null||stu_id.equals("")){%><scriptlanguage="javascript">alert('请输入要查询的学号!');</script><%}else{aList=stu.queryStudent(dep,stu_id);if(aList==null||aList.size()<=0){%><scriptlanguage="javascript"type="">alert('没有该学生信息!');</script><%}}}%><html><head><linkhref="Inc/student_com.css"type="text/css"rel="stylesheet"><metahttp-equiv="Content-Type"content="text/html;charset=gb2312"></head><body><tablewidth="100%"border="0"><tr><palign="center"><fontcolor="#00FF00"size="+3"face="华文行楷">查询学生信息列表</font></p></tr><formname="form1"method="post"action=""><%if(aList!=null&aList.size()>0){Studentstu2=newStudent();for(inti=0;i<aList.size();i++){stu2=(Student)aList.get(i);%><tr><td>请输入要查询的学号:</td><td><inputname="stu_id"type="text"class="text1"value="<%=stu2.getId()%>"></td><td><inputname="queryButton"type="submit"value="查询"></td></tr><divalign="center"><tablecellpadding="2"cellspacing="1"><tr><tdalign="center"bgcolor="#EEEEEE">姓名</td><tdalign="center"bgcolor="#EEEEEE">密码</td><tdalign="center"bgcolor="#EEEEEE">年龄</td><tdalign="center"bgcolor="#EEEEEE">籍贯</td><tdalign="center"bgcolor="#EEEEEE">系别</td><tdalign="center"bgcolor="#EEEEEE">性别</td><tdalign="center"bgcolor="#EEEEEE">入学年份</td><tdalign="center"bgcolor="#EEEEEE">班级</td><tdalign="center"bgcolor="#EEEEEE">辅导员</td></tr><tr><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getName()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getPassword()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getAge()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getJiguan()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getDep()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getSex()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getEntry()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getClassid()%></td><tdalign="center"bgcolor="#FFFFFF"><%=stu2.getAssitant()%></td></tr>出现错误的地方——》<%}}%></table></div><palign="center">&nbsp;</p><divalign="center"><ahref="javascript:history.back();">返回</a></div></form></table></body></html>***********************************2Student.java*************************************packageBean;importjava.sql.ResultSet;importjava.sql.SQLException;importjava.util.ArrayList;importSQL.SQLBean;publicclassStudent{privateStringid;privateStringpassword;privateStringname;privateStringsex;privateStringjiguan;privateStringclassid;privateStringdep;privateStringassitant;privateintage;privateintentry;}publicvoidsetAssitant(Strings){assitant=s;}publicStringgetAssitant(){returnassitant;}publicvoidsetClassid(Strings){classid=s;}publicStringgetClassid(){returnclassid;}publicvoidsetAge(intage){this.age=age;}publicintgetAge(){returnage;}publicvoidsetDep(Strings){dep=s;}publicStringgetDep(){returndep;}publicvoidsetSex(Strings){sex=s;}publicStringgetSex(){returnsex;}publicvoidsetEntry(intyear){entry=year;}publicintgetEntry(){returnentry;}publicStringgetId(){returnid;}publicvoidsetId(Stringid){this.id=id;}publicStringgetName(){returnname;}publicvoidsetName(Stringname){this.name=name;}publicStringgetPassword(){returnpassword;}publicvoidsetPassword(Stringpassword){this.password=password;}publicStringgetJiguan(){returnjiguan;}publicvoidsetJiguan(Stringjiguan){this.jiguan=jiguan;}publicArrayListqueryStudent(Stringdep,Stringstu_id){Stringsql="";ArrayListarrayList=newArrayList();if(dep.equals("0000")){sql="selectstudent.*,department.NAMEfromstudent,departmentwherestudent.DEPARTMENT=department.IDandstudent.id='"+stu_id+"'";}else{sql="selectstudent.*,department.NAMEfromstudent,departmentwherestudent.DEPARTMENT=department.IDandDEPARTMENT='"+dep+"'"+"andstudent.id='"+stu_id+"'";}SQLBeandb=newSQLBean();try{ResultSetrs=db.executeQuery(sql);intflag;while(rs.next()){Studentstu=newStudent();stu.setId(rs.getString(1));stu.setAge(rs.getInt(6));stu.setName(rs.getString(3));stu.setPassword(rs.getString(2));stu.setJiguan(rs.getString(7));stu.setDep(rs.getString(13));stu.setSex(rs.getString(4));stu.setClassid(rs.getString(8));entry=Integer.parseInt(rs.getString(5).substring(0,4));stu.setEntry(entry);stu.setAssitant(rs.getString(10));arrayList.add(stu);}returnarrayList;}catch(SQLExceptionex){ex.printStackTrace();returnnull;}finally{db.CloseDataBase();}}

解决方案

解决方案二:
aList!=null&aList.size()>0这个写错了吧。你写的是与运算了aList!=null&&aList.size()>0
解决方案三:
不是这个原因这个是我刚才重写时落下啦。

时间: 2024-09-17 03:00:01

求助:出现错误 The server encountered an internal error () that prevented it from fulfilling this request.的相关文章

The server encountered an internal error () that prevented it from fulfilling this request.

问题描述 typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionjavax.servlet.ServletException:Errorallocatingaservletinstanceorg.apache.catalina.valves.ErrorReportValve.invoke(ErrorRep

The server encountered an internal error () that prevented it from fulfilling th

问题描述 org.apache.jasper.JasperException:java.lang.NullPointerExceptionorg.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:541)org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:435)org.apache.j

escription The server encountered an internal error () that prevented

问题描述 HTTP Status 500 - --------------------------------------------------------------------------------type Exception report用ssh做的.前一个登录都实现了.但是现在做注册却出现了问题.查了好多资料,说是配置的问题,我想着应该不会啊,要不登录怎么实现的.什么原因??message description The server encountered an internal

The server encountered an internal error () that prevented it from fulfillin

问题描述 连接成功java.lang.NullPointerExceptionatcom.blog.toolsBean.JDBConnection.getStm(JDBConnection.java:40)atcom.blog.toolsBean.JDBConnection.executeQuery(JDBConnection.java:71)atcom.blog.dao.ConsumerDao.getConsumerForm(ConsumerDao.java:89)atcom.blog.ser

jsp问题: The server encountered an internal error () that prevented it from fulfil

问题描述 HTTPStatus500-typeExceptionreportmessagedescriptionTheserverencounteredaninternalerror()thatpreventeditfromfulfillingthisrequest.exceptionorg.apache.jasper.JasperException:java.lang.IllegalStateException:Nooutputfolderorg.apache.jasper.servlet.J

解决方案-The server encountered an internal error

问题描述 The server encountered an internal error 解决方案 最近用perl写cgi程序,当传到服务器上后,web页面就出现下面的错误, Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. 出现这种问题是文件的权限设置的不对,linux下文件单......答案就在

我是javaee新手,运行数据库出现这样的问题不知道怎么修改description The server encountered an internal err

问题描述 <%@ page language="java" import="java.sql.*"%><%@ page contentType="text/html;charset=GB18030"%><%@ page import="java.util.*" %><%reponse.setCharacterEncoding("GB18030");String su

sql-【SQL求助】用SQL Server查询语句中,IN 的使用问题。

问题描述 [SQL求助]用SQL Server查询语句中,IN 的使用问题. 我想查询一辆车在一个月内的记录.于是编写了如下代码: select * from 北京车辆能耗数据.dbo.北京朝批商贸股份有限公司 where ( [列 0] in ('京AC3537') and CAST ([列 2] as datetime)>'2013/11/1 00:00:00' and CAST ([列 2] as datetime)<'2013/12/1 00:00:00' ) order by CAS

SQL Server 2005 sp_send_dbmail出现Internal error at FormatRowset (Reason: Not enough storage is available to complete this operation)

案例环境:   操作系统: Windows 2003 SE 32bit(SP2) 数据库版本:Microsoft SQL Server 2005 - 9.00.5069.00 (Intel X86)             Aug 22 2012 16:01:52             Copyright (c) 1988-2005 Microsoft Corporation             Standard Edition on Windows NT 5.2 (Build 3790: