I am modifying behavior of a web-app(server & client) running on web-sphere. I have de-compiled the code and just need to make minor changes and redeploy the code.
For this I made a simple Java Project with Eclipse EE and loaded all the de-compiled code. I only need the *.class files which I will convert to a JAR and place them at their proper place. The thing is there is a dependency which is not being resolved javax.servlet.http.HttpServletRequest
so my project is not building
How to resolve this dependency?
If this dependency cannot be resolved than my guess is I could just get the JAR file for javax.servlet.http.HttpServletRequest
and add to the Project's Build Path as an external JAR.
Where can I find the JAR for javax.servlet.http.HttpServletRequest
p.s. I am new to JAVA so I don't know much about HttpServletRequest
also I am using Java 1.6 JRE.
You'll want to add the Servlet API as a "provided" dependency. That is, you only use it to compile the code, but you don't need to package it with your web application since your web container will already contain a copy of it.
A long time ago I used to manually add the servletapi.jar into my eclipse project, but that is a bad practice.
Now I just create a Dynamic Web Project, then add a server (usually Tomcat), then right click on the new project - select properties - select project facets and add the Tomcat Server as the runtime. It has the files you need. Once you hit the apply button and okay button it will resolve the missing import files.
Here is a step by step description from a similar question on SO: How do I import the javax.servlet API in my Eclipse project?
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