aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes Eclipse - The import javax.servlet.http.HttpServletRequest cannot be resolved Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "Eclipse - The import javax.servlet.http.HttpServletRequest cannot be resolved" Watch "Eclipse - The import javax.servlet.http.HttpServletRequest cannot be resolved" New topic
Author

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

Jon Koon
Greenhorn

Joined: Jun 04, 2009
Posts: 2
I just switched to plain old Eclipse from MyEclipse for development, and my struts application was running great. But now I am getting this error "The import javax.servlet.http.HttpServletRequest cannot be resolved" over and over again but inconsistently. Sometimes my app runs with no problems and sometimes I get the error. A lot of times I can fix it by removing the project from the server and then adding it again within the Eclipse -> Server interface. It is an especially painful issue, becuase it is inconsistent.

Here is an excerpt of the error

SEVERE: Error creating form bean of class com.****.struts.beans.*********
java.lang.Error: Unresolved compilation problem:
The import javax.servlet.http.HttpServletRequest cannot be resolved

I'm new to the forum, so I appreciate any guidance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12788
    
    5
Sounds like an eclipse classpath problem to me, not a servlet or Tomcat problem.

Bill
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61226
    
  66

Please be sure to ask IDE questions in the IDEs forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Jon Koon
Greenhorn

Joined: Jun 04, 2009
Posts: 2
Sorry about that. Thanks for moving the post for me.

I have added j2ee.jar and javaee.jar to the classpath, but I still get the error every time I make a change to the source code and the context is reloaded into Tomcat.

[Edit]

So I think that I just misunderstood how Eclipse interacts with Tomcat. This FAQ helped out a lot.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Eclipse - The import javax.servlet.http.HttpServletRequest cannot be resolved