Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » Can't resolve HttpServlet
Can't resolve HttpServlet [message #1597079] Mon, 02 February 2015 03:56 Go to next message
Kevin Hale Boyes is currently offline Kevin Hale BoyesFriend
Messages: 2
Registered: February 2015
Junior Member
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?

Thanks,
Kevin.
Re: Can't resolve HttpServlet [message #1597967 is a reply to message #1597079] Mon, 02 February 2015 17:40 Go to previous messageGo to next message
Larry Isaacs is currently offline Larry IsaacsFriend
Messages: 1354
Registered: July 2009
Senior Member
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?
>
> Thanks,
> Kevin.

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.

Cheers,
Larry
Re: Can't resolve HttpServlet [message #1598620 is a reply to message #1597967] Tue, 03 February 2015 04:02 Go to previous message
Kevin Hale Boyes is currently offline Kevin Hale BoyesFriend
Messages: 2
Registered: February 2015
Junior Member
Wow. This is exactly what I was after.
Thanks so much!
Previous Topic:How to Parse JSP
Next Topic:Extremely slow jsp editing
Goto Forum:
  


Current Time: Tue Apr 24 23:26:20 GMT 2018

Powered by FUDForum. Page generated in 0.02412 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software