解决JSP中,类无法被编译的问题(XX cannot be resolved to a type)
来源:互联网 发布:理财 推荐 知乎 编辑:程序博客网 时间:2024/05/06 01:10
错误调试解析:
An error occurred at line: XX in the jsp file: /XX.jsp
XX cannot be resolved to a type
解决方法:
一、 检查是否导入相应的包,在页面开头引入相应的包 <%@ page import="xx.Xx" %>
二、 因为某些特殊原因,MyEclipse没能自动编译源代码到build/classes(或其他classes目录),
导致类型查找不到,可能是MyEclipse未编译自己编写的类,在Tomcat的Webapp目录中删除该项目后,
重新部署,如果还未解决,则如下设置:
Windows–>Preferences–>Java–>Compiler–>Building–>Output folder–>
”Rebuild class files modified by others”. 勾选,然后重新启动Tomcat
三、在tomcat启动时,为tomcat添加引用路径,先把classes文件夹导入到JVM中。
tomcat在调用类的时候,就不会找不到了。
具体操作方法是:使用MyEclipse的tomcat插件,在MyEclipse的主界面菜单window下的preferences对话框中,
找到Tomcat插件的那一项,选择JVMsetting,有一个classpath(before generated classpath)中,
导入你的classes文件夹。就可解决此问题。
相同的,如果tomcat运行时出现了找不到引用的jar包,也可以在这里设置导入。
- 解决JSP中,类无法被编译的问题(XX cannot be resolved to a type)
- JSP页面无法正常翻译问题 ---jsp cannot be resolved to a type
- java中”XX cannot be resolved to a type”的报错信息
- 解决cannot be resolved to a type
- javax.servlet.jsp.PageContext cannot be resolved to a type问题如何解决???
- maven中解决javax.servlet.jsp.PageContext cannot be resolved to a type
- XX cannot be resolved to a type 报错
- "XX cannot be resolved to a type "eclipse报错及解决
- XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type " eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- "XX cannot be resolved to a type "eclipse报错及解决说明
- 谈做百度优化的技巧
- Ubuntu12.04安装及Waiting for headers问题的解决
- 手掌是人体健康的晴雨表
- ARM裸机程序开发16(混合编程)
- sqlplus: error while loading shared libraries: libsqlplus.so: cannot open shared object file: No suc
- 解决JSP中,类无法被编译的问题(XX cannot be resolved to a type)
- 中国致公党中央委员会致信感谢安生
- SSH
- 有史以来最全的poj题目总结推荐(2012年最新)
- 将文件系统写入到开发板的过程
- MFC-设备坐标和逻辑坐标
- LoadRunner - Failed to connect to server "127.0.0.1:8888"
- linux 内存共享
- Android程序退出彻底关闭进程的方法