The import Javax.servlet.ReadListener cannot be resolved

Source: Internet
Author: User
Tags tld



Cause: This is because your project BuildPath wrong.



Solution: Right-click Project-------BuildPath--------The bottom of the configuration selection libraries find the JRE (this time you will find the JRE in front of it!). or red X) select Remove to re-select a JRE for the project, project----clean



Java.lang.UnsupportedClassVersionError:Bad version number in. class file exception



Deployment project also occurred because of different versions caused problems, then we use the IDE compiler is JDK5.0, and that Linux is JDK6.0, after deployment found a lot of functions are wrong, it seems that some things still have to pay attention to AH.
The method of changing the compiler in MyEclipse: Project->properties->java compiler->configure Workspace Setting, can be set in the popup page.



The import Org.apache cannot be resolved



What IDE is you using? If It's eclipse, right click on the project, build path, Configure build, Libraries, Add External Jar ' s



Error:
The import Javax.servlet cannot be resolved



Solve:



1, this is because the project inside the Web-inf/lib directory under the packet: package javax.servlet caused;



(Introduction to the package can be found in: http://java.sun.com/products/servlet/2.5/docs/servlet-2_5-mr2/index.html)



2, in Tomcat (my current version 6.0.32) Lib directory servlet-api.jar, copy it into the project Web-inf/lib directory; Unable to read TLD "Meta-inf/c.tld" from Jar File's



Delete the Jsp-api.jar under Web-inf\lib\. Servlet-api. JAR, restart the problem resolution,



Cause: When compiling the package, the Java build path does not have the environment variable configured, and the reason for the conflict between the two packages under web-inf\lib\ and the jar package of Lib in Tomcat. Javax.servlet.jsp.PageContext cannot is resolved to a type



One of the JSP contents is as follows, in eclipse the JSP problem as shown in the title Javax.servlet.jsp.PageContext cannot is resolved to a type:
<%@ taglib uri= "/web-inf/tld/jstl/c.tld" prefix= "C"%>
<c:set var= "CTX" value= "${pagecontext.request.contextpath}"/>
Internet query, the solution is to <c:set var= "CTX" value= "${pagecontext.request.contextpath}"/> to <c:set var= "CTX" value= "${ PageContext. [' Request '].contextpath} '/>, there will be no such problem, but strangely, then change back to <c:set var= "CTX" value= "${ PageContext.request.contextPath} "/> No longer appears this problem. Eclipse seems to have a point in the syntax test for JSP.
# Re:javax.servlet.jsp.PageContext cannot is resolved to a type of resolution 2009-06-02 11:32 passers by
You didn't find the problem at all. The solution to the problem lies in
Add Jsp-api.jar to the classpath.
Jsp-api.jar located under Tomcat-home/common/lib can not find the tag library descriptor for "HTTP://JAVA.SUN.COM/JSP/JSTL/FMT"



Whether the jar packages in 1.web-inf/lib are Jstl
is the 2.tld file in?
is jsp-config taglib defined in 3.web.xml?


<jsp-config>  
        <taglib>  
            <taglib-uri>http://java.sun.com/jstl/fmt</taglib-uri>  
            <taglib-location>/WEB-INF/tlds/fmt.tld</taglib-location>  
        </taglib>  
        <taglib>  
            <taglib-uri>http://java.sun.com/jstl/fmt-rt</taglib-uri>  
            <taglib-location>/WEB-INF/tlds/fmt-rt.tld</taglib-location>  
        </taglib>  
</jsp-config>


Eclipse's newly imported project often sees "XX cannot is resolved to a type" error message. This article will be done with a simple summary.

(1) JDK mismatch (or non-existent)
The JDK specified by the project is "jdk1.6.0_18", while current eclipse is using "jdk1.6.0_22". Need to be in BuildPath | Libraries, make simple adjustments in.
(2) Missing or conflicting jar packages
This error is reported when the jar containing the "XX" is not found. Resolve only need to find (CTRL + click, may see the jar package name) corresponding to the Jar package import project.
In addition, this error will also be reported when the same xx appears. You may need to swap, unpack, or delete.
(3) Eclipse Find project type policy caused



Eclipse, the above two have been compared, there is no problem, but also reported this mistake. At this point, you need to work on Project | Clean ..., the problem can be solved. The reason is that the mechanism is responsible. For some special reasons, Eclipse failed to automatically compile the source code into build/classes (or other classes directories), causing the type to not be found. Coding issues



These are the more common errors, the error I encountered here is caused by the file encoding!



The error is similar, this is only a partial interception:






Workaround:



Right-click on the item that has the error "Properties"






On the left, select "Resource", the right text file encoding select "Other:utf-8" and click "Apply" button.






The import Javax.servlet.ReadListener cannot be resolved


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.