Is there any way I can access RESTful webservice using a servlet. I dont want to use Jersey client?
EDIT: How can I pass object in the url and make sure that marshalling/unmarshalling is done properly?
3 Answers
You could code your own HTTP requests e.g. using HTTPURLConnection. Here you can set the request method and change the URL or/and body as appropiate e.g.
URL url = new URL("http://www.example.com/resource");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("GET");
// etc
This way you're just using the standard java.net API.