今天刚弄好MyEclipse环境,试了一下jsp的创建,然后就出现了一个很令人纠结的问题。

文档目录如下:

Jsp代码如下:

<%@page import="com.pd.Person"%>
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<%
Student stu=new Student();//使用默认的包,这个会出错
Person p=new Person(); //导入了包,没有问题
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
</html>

出错信息如下:

org.apache.jasper.JasperException: Unable to compile class for JSP: 

An error occurred at line: 4 in the jsp file: /test.jsp
Student cannot be resolved to a type

1: <%@page import="com.pd.Person"%>
2: <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
3: <%
4: Student stu=new Student();//使用默认的包,这个会出错
5: Person p=new Person(); //导入了包,没有问题
6: %>
7: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

很纠结的问题,使用默认包的类会提示这个错误。

JSP Unable to compile class for JSP的更多相关文章

  1. JSP连接数据库,报Unable to compile class for JSP

    先看一下报错原因: HTTP Status 500 - Unable to compile class for JSP: type Exception report message Unable to ...

  2. org.apache.jasper.JasperException: Unable to compile class for JSP

    项目启动时报错 : The method getJspApplicationContext(ServletContext) is undefined for the type JspFactory S ...

  3. jsp调用javabean出现错误HTTP Status 500 - Unable to compile class for JSP

    HTTP Status 500 - Unable to compile class for JSP:   type Exception report message Unable to compile ...

  4. Count:858org.apache.jasper.JasperException: Unable to compile class for JSP

    1.错误描述 Count:858org.apache.jasper.JasperException: Unable to compile class for JSP: An error occurre ...

  5. Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Unable to compile class for JSP] with root cause java.lang.IllegalArgumentException: Page directive: inval

    严重: Servlet.service() for servlet [jsp] in context with path [/Healthy_manager] threw exception [Una ...

  6. Unable to compile class for JSP

    https://www.cnblogs.com/mthoutai/p/7136304.html 错误提示: The return type is incompatible with JspSource ...

  7. tomcat启动后,页面浏览时报错 Unable to compile class for JSP的解决方案【原创】

    问题描述: tomcat启动后,console正常,console中语句为: 信息: Server startup in 7291 ms   但浏览器访问首页面http://localhost:808 ...

  8. JAVA Drp项目实战—— Unable to compile class for JSP 一波三折

    交代下背景.电脑系统是64位的,用的是64位的Tomcat.安装是32位的Myeclipse10,java环境也是32位的.Tomcat在開始启动时会报这样一个错误,"Can't load ...

  9. tomcat启动后,页面浏览时报错 Unable to compile class for JSP的解决方案

    转:tomcat启动后,页面浏览时报错 Unable to compile class for JSP的解决方案 检查tomcat与web工程对应版本,tomcat中对应版本的jar包拷贝到web工程 ...

随机推荐

  1. 使用 Nginx 提升网站访问速度

    使用 Nginx 提升网站访问速度 http://www.ibm.com/developerworks/cn/web/wa-lo-nginx/ Nginx 简介 Nginx ("engine ...

  2. docker——安全防护与配置

    Docker是基于Linux操作系统实现的应用虚拟化.运行在容器内的进程,跟运行在本地系统的进程本质上并无区别,配置不合适的安全策略将可能给本地系统带来安全风险,因此,Docker的安全性在生产环境中 ...

  3. poj1177 Picture 矩形周长并

    地址:http://poj.org/problem?id=1177 题目: Picture Time Limit: 2000MS   Memory Limit: 10000K Total Submis ...

  4. Spring整合Quartz定时发送邮件

    功能描述:刚开始接触Quartz,试着用Quartz整合spring实现每隔一分钟发送一封邮件连续发送10次 核心jar: 邮件发送:commons-email-1.2.jar mail.jar(必须 ...

  5. linux wa%过高,iostat查看io状况

    命令总结: 1. top/vmstat 发现 wa%过高,vmstat b >1: 参考文章: 1. 关于Linux系统指令 top 之 %wa 占用高,用`iostat`探个究竟 最近测试一项 ...

  6. Python3.x:requests的用法

    Python3.x:requests的用法 1,requests 比 urllib.request 容错能力更强: 2,通常用法: (1).认证.状态码.header.编码.json r = requ ...

  7. 20145325张梓靖 《Java程序设计》第1周学习总结

    20145325张梓靖 <Java程序设计>第1周学习总结 教材学习内容总结 JAVA三大平台:Java SE.Java EE .Java ME Java SE四个组成部分:JVM .JR ...

  8. linux下如何kill tty终端

    答:一共有两个步骤,如下: 1.列出打开的终端 who 2.kill需要kill的tty终端 pkill -kill -t pts/2

  9. luogu P1017 进制转换

    感觉这个题 是真的恶心 本来单纯就递归写,发现好难 后来用数组记录 然后考虑 指数为 奇和偶数 分别 <0 和 > 进制的情况 其实 用进制数为3 大概讨论四种情况就可以了 由于最近就是在 ...

  10. [微信开发] - weixin4j关键类解析

    TokenUtil : get()获取我方自定义的token(从配置文件或数据库) checkSignature(Str..... (服务器配置连接验证有效性) /* * 微信公众平台(JAVA) S ...