An issue that prompts HttpServletRequest to be referenced when importing external projects in Eclipse __ECLISPE

Source: Internet
Author: User
Javaexception

Error:

The import Javax.servlet cannot be resolved

The import javax.servlet.http.HttpServletRequest cannot be resolved

Describe:

We often take other people's projects copy to their own here for two development or reference, and sometimes the above error, that is, the Eclipse project we import the project hint HttpServletRequest can not be cited, will accompany the headache of the small red fork appear.

Reason:

The specific reason is that our project inside the Web-inf/lib directory less the corresponding package: Package javax.servlet.http caused by, popular and exactly speaking is the lack of tomcat_home\lib under the Servlet-api.jar.

I import other people's projects, on other people's machines he configured the server, is generally tomcat, and in the process of copying the server's library will not be copied with the project, unless someone else the Tomcat library has been copied to the web-inf\ Lib under the.

Workaround:

Project-> Properties-> Java build Path-> Add Library-> server Runtime-> next-> Select your Server-> Fi Nish

Related Article

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.