紧急求助一个jsp编译错误,说j cannot be resolvedd to a type,高手

JSP cannot be resolved to a type - 开源中国社区
当前访客身份:游客 [
当前位置:
我自定义了一个jsp标签,运行时出现了&cannot be resolved to a type的错误。
我的标签定义文件chen.tld在WEB-INF目录下,编译好的.class放在classes目录下。web.xml也进行了配置。
&jsp-config&
&taglib-uri&/tags/chen.tld&/taglib-uri&
&taglib-location&/WEB-INF/chen.tld&/taglib-location&
&/jsp-config&&
jsp使用:&%@ taglib uri=&/tags/chen.tld& prefix=&mytag& %&&mytag:queryC driver=&com.mysql.jdbc.Driver& url=&jdbc:mysql://localhost/menagerie& user=&root& pwd=&love& sql=&select * from pet& /&
共有1个答案
<span class="a_vote_num" id="a_vote_num_
你好,请问你这个问题最后是怎么解决的呢?
更多开发者职位上
有什么技术问题吗?
类似的话题使用Maven创建Web后,jsp引入静态文件提示报错。错误提示:x.servlet.ServletException cannot be resolved to a type错误如下图::在Maven的pom文件中引发如下依赖即可:&dependency&&groupId&javax.servlet.jsp&/groupId&&artifactId&jsp-api&/artifactId&&&2.2.1-b03&/version&&/dependency&&dependency&&groupId&javax.servlet&/groupId&&artifactId&servlet-api&/artifactId&&version&3.0-alpha-1&/version&&/dependency&友情链接:Maven 中央仓库地址:/7915人阅读
解决办法:
&& 右键项目名&Properties&Java Build Path&Libraries&选中JRE System Library[Sun JDK 1.6.0_13]&Edit&选中&Workspace default JRE(Sun JDK 1.6.0_13)&&Finish
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:507222次
积分:3533
积分:3533
排名:第7048名
原创:40篇
转载:42篇
评论:87条
(1)(1)(7)(3)(8)(4)(6)(6)(19)(3)(7)(4)(9)(5)ConnDB cannot be resolved to a type,jsp中的一个常见的异常。_apache_ThinkSAAS
ConnDB cannot be resolved to a type,jsp中的一个常见的异常。
ConnDB cannot be resolved to a type,jsp中的一个常见的异常。
点击右边红色标题查看本文完整版:type Exception report
description The server encountered an internal error () that prevented it from fulfilling this request.
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. com.ConnDB resolves to a package
An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 39 in the jsp file: /index.jsp
Generated servlet error:
co cannot be resolved
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
root cause
org.apache.jasper.JasperException: Unable to compile class for JSP
Generated servlet error:
Only a type can be imported. com.ConnDB resolves to a package
An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 25 in the jsp file: /index.jsp
Generated servlet error:
ConnDB cannot be resolved to a type
An error occurred at line: 39 in the jsp file: /index.jsp
Generated servlet error:
co cannot be resolved
org.piler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:84)
org.piler.ErrorDispatcher.javacError(ErrorDispatcher.java:328)
org.piler.JDTCompiler.generateClass(JDTCompiler.java:414)
org.pile(Compiler.java:297)
org.pile(Compiler.java:276)
org.pile(Compiler.java:264)
org.apache.pile(JspCompilationContext.java:563)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:303)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.
------解决方法--------------------------------------------------------
把index.jsp的内容贴出来吧
------解决方法--------------------------------------------------------
ConnDB cannot be resolved to a type
旧这句啦,检查一下ConnDB,还有对应的包
------解决方法--------------------------------------------------------
Unable to compile class for JSP:
1. jsp代码有问题,查看是否有语法错误。
2. jsp中引用的类是否没有导入。不能解析对象以及方法,造成jsp无法编译。
------解决方法--------------------------------------------------------
Unable to compile class for JSP:
Unable : 不能
compile: 编译
class : 类
PHP开发框架
开发工具/编程工具
服务器环境
ThinkSAAS商业授权:
ThinkSAAS为用户提供有偿个性定制开发服务
ThinkSAAS将为商业授权用户提供二次开发指导和技术支持
让ThinkSAAS更好,把建议拿来。
开发客服微信

我要回帖

更多关于 x cannot be resolved 的文章

 

随机推荐