| 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: 12267
|
|
Sounds like an eclipse classpath problem to me, not a servlet or Tomcat problem.
Bill
|
Java Resources at www.wbrogden.com
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56179
|
|
|
Please be sure to ask IDE questions in the IDEs forum. I have moved this post there for you.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About 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.
|
 |
 |
|
|
subject: Eclipse - The import javax.servlet.http.HttpServletRequest cannot be resolved
|
|
|