I am trying to make an application connect to Google Plus API, but for this I need to have some request parameters kept secret. This is why I cannot just make a simple ajax request or create a form with hidden inputs. My solution is to make a request to a servlet and from there, with HttpClient another request to Google.
Here is the problem:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println(TestClass.makeRequest());
}
TestClass.makeRequest() creates the HttpPost object, gets the response and returns a String.
When I run this on the server, I get this error:
java.lang.ClassNotFoundException: org.apache.http.HttpEntity
I do not understand why this happens. Can you provide a solution please?
Any other methods for transmitting hidden parameters in a request are helpful.
It appears that while you have all the necessary jar files in your build path, they are not deployed with your servlet. These 2 operating environments are different.
To make the 3d party libraries available to your servlet classes make sure to that
httpcore-4.0.1.jarand all other dependent jars are deployed to thedirectory of your web app.