On 2/2/2015 11:28 AM, Kevin Hale Boyes wrote:
> I've been reading and following the examples in the Apres Tomcat 7 book
> and have a question about creating a new web project in eclipse.
> I'm using the EE version of Luna and have created a new Dynamic Web
> Project. I want to create a new servlet but eclipse is telling me that
> HttpServlet cannot be resolved to a type.
> I created a new Tomcat server configuration and I kind of figured that a
> web project would be able to resolve classes from the servlet API
> without further configuration.
> Do I need to manually add the servlet API jars to my
> WebContent/WEB-INF/lib directory? Is there something else that I should
> be doing to resolve the HttpServlet class?
These classes are normally provided by the Target Runtime you have
selected for the Dynamic Web Project. This choice is available on the
first page of the Dynamic Web Project wizard. For an existing project,
you can see this selection by opening the project's Properties dialog,
selecting Project Facets and then selecting Runtimes tab over on the
right. It will show you the available server runtimes and which, if
any, the project is currently using.