HttpServlet cannot is resolved to a type

Source: Internet
Author: User

DescriptionResourcePathLocationType
HttpServlet cannot is resolved to a typeSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 15Java problem
HttpServletRequest cannot is resolved to a typeSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 22Java problem
HttpServletResponse cannot is resolved to a typeSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 22Java problem
Servletexception cannot is resolved to a typeSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 22Java problem
The import Javax.servlet cannot be resolvedSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 5Java problem
The import Javax.servlet cannot be resolvedSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 6Java problem
The import Javax.servlet cannot be resolvedSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 7Java problem
The import Javax.servlet cannot be resolvedSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 8Java problem
The import Javax.servlet cannot be resolvedSimpleservlet.java/javahelloworldapp/src/main/java/wasdev/sample/servletLine 9Java problem

Webservlet cannot is resolved to a typesimpleservlet.java/javahelloworldapp/src/main/java/wasdev/ Sample/servletLineJava problem


In the article Java, the Rest API uses examples--based on cloud Platform + cloud services to build your own online translator tool downloaded from IBM bluemix Java sample code, after importing into eclipse, the above error message appears!


Cause of Error:

Eclipse is just installed, and the server is not configured to run the environment!

Workaround:

1, first to install Tomcat;

Usually is to download a zip compression package, unzip it;

2. In Eclipse, click the Window menu and select Preferences


3. Expand server on the left, select Runtime Environment, right click the Add button


4. Select your Tomcat version in the Pop-up window


5. Click the "Browse" button to select the installation location of Tomcat, select the appropriate JRE version, click the Finish button to complete.


With the above steps, all of the above errors are resolved, and if your project also shows errors, there are other reasons to consider.


can refer to: XXX cannot is resolved to a type error resolution method



HttpServlet cannot is resolved to a type

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.