Every thing was fine and i was able to run this JSP project, suddenly some thing happened and mostly all my servlets getting unresolved error.
I know its because specific JAR file cant be found for compilation.. but my "buildpath" is fine and i didnt make any changes..
I am stuck in this situation...
Tried
"cannot be resolved to a type" means that the compiler has decided that, according to the syntax of the language, what it found at this place in the code has to be type, which means either a class, an interface, or a primitive tpye, but cannot find the definition of any type with that name.
Add the server runtime to the web project to fix the HttpServlet not found Eclipse error. This will add all the JAR and ZIP files used by the servlet engine to the web project's runtime path. When this step is complete, rebuild the project and the HttpServlet not found Eclipse error message will go away.
You have to set the runtime for your web project to the Tomcat installation you are using; you can do it in the "Targeted runtimes" section of the project configuration.
In this way you will allow Eclipse to add Tomcat's Java EE Web Profile jars to the build path.
Remember that the HttpServlet class isn't in a JRE, but at least in an Enterprise Web Profile (e.g. a servlet container runtime /lib folder).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With