把一个原来的能运行的项目从新导入到另一个eclipse里在运行就报这个错误!!!!!
以前运行环境:eclipse + tomcat6
现在运行环境:eclipse + tomcat7
********************错误信息如下*********************type Exception reportmessage description The server encountered an internal error () that prevented it from fulfilling this request.exception org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurred at line: 49 in the generated java file
The method setContentType(String) is undefined for the type HttpServletResponseAn error occurred at line: 50 in the generated java file
The method getPageContext(Servlet, ServletRequest, ServletResponse, String, boolean, int, boolean) in the type JspFactory is not applicable for the arguments (index_jsp, HttpServletRequest, HttpServletResponse, null, boolean, int, boolean)Stacktrace:
org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:97)
org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:457)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:374)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:352)
org.apache.jasper.compiler.Compiler.compile(Compiler.java:339)
org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:601)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:344)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:389)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:333)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
note The full stack trace of the root cause is available in the Apache Tomcat/7.0.16 logs.

解决方案 »

  1.   

    An error occurred at line: 49 in the generated java file
    把一些Java代码贴出来
      

  2.   

    <%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>东北电网信息技术培训系统</title>
    </head>
    <style type="text/css">
    <!--
    body {
    margin-left: 0px;
    margin-top: 0px;
    margin-right: 0px;
    margin-bottom: 0px;
    background-color: #C2C2C2;
    background-image: url(img/hearder1.jpg);
    background-repeat: repeat-x;
    }
    -->
    </style>
    <body>
    <table height="580" width="100%" id="table" class="table" border="0"
    cellpadding="0" cellspacing="0">
    <tr>
    <td height="580" width="50%" id="td" align="center"><img
    src="img/12.png">
    </td> <td>
    <table height="220" width="100%" id="table" class="table" border="0"
    cellpadding="0" cellspacing="0"> </table>
    <form name="form" action="jsp/main_menu.jsp" method="post">
    <table height="140" width="100%" id="table" class="table"
    border="0" cellpadding="0" cellspacing="0">
    <tr align="left">
    <td colspan="2">登陆东北电网信息技术培训系统</td>
    </tr>
    <td width="20%" align="right">用户名:</td>
    <td align="left"><input type="text" name="username" value=""
    id="username">
    </td>
    <tr>
    <td width="20%" align="right">密码:</td>
    <td align="left"><input type="password" name="password"
    value="" id="password">
    </td>
    </tr>
    <tr align="center">
    <td></td>
    <td align="left"><input type="submit" name="submit"
    value="登陆" id="submit1">
    </td>
    </tr>
    </table>
    </form>
    <table height="220" width="100%" id="table" class="table" border="0"
    cellpadding="0" cellspacing="0">
    <tr>
    <td><img align="right" src="img/login-wel.gif">
    </td>
    </tr>
    </table></td>
    </tr>
    </table>
    </body>
    </html>
      

  3.   

    我觉得应该是JDK版本的问题,原有环境和现在环境的JDK版本不一样导致的
      

  4.   

    jdk是一样的 都是JDK1.6 就是tomcat版本换了
      

  5.   

    真正需要的jar包没有用上像HttpServletResponse是属于javaee的
    或者是版本问题(可能过新也可能过旧)或者根本没加入到build classpath中
    查看一下原来好的都是用的什么相关jar包