Javax.servlet. * cannot be allowed for type

I run ubuntu 14.04 and eclipse Kepler (with java ee modules preloaded), I am developing the Dynamic Web App for the first time, it always says that javax.servlet.xyz cannot be resolved for type, please help, I turned on the screen instantly snapshot for my error page!

System snapshot

+6
source share
1 answer

Eclipse only needs two things to do this:

One

In Eclipse, Window β†’ Settings β†’ Server β†’ Workspace

Specify your web server or application server path by adding "New Server Runtime."

Update

Initially, only a few Runtime runtime environments are available in Eclipse:

  • Apache
  • The main
  • Objectweb

As an additional note, you can add additional server adapters using the Download additional server adapters adapters link Download additional server adapters dialog box.

Server Runtime ENvironment List in Eclipse Preferences

Two

In the project properties (right-click on the project β†’ properties) in the Java build path, add the "Server Runtime" library.
When adding server runtime to the project library, the servlet-api.jar and jsp-api.jar banks will be added to the project dependencies.

Add Server Runtime Library to Project

+19
source

Source: https://habr.com/ru/post/971429/


All Articles