Blog Archives
Page 1 of 2
1 2

Apache HTTPClient POST request sample code

This extends the Apache HTTPClient Tutorial to invoke RESTFul service with a POST request.

The pom.xml

The client using HttpClient & JAXBContext

The “JAXBContext” is from the Java 6 onwards. The sample code includes

1) Exception handling.

2) “BasicCredentialsProvider”

Read more ›



Apache HTTPClient Tutorial to invoke RESTFul service

Apache HttpClient to invoke a RESTful Web Service. This is a GET request, and in the next post will extend this to use an HTTP POST with basic authentication.

Step 1: Create a Maven project say “httpRestClient”. Just press enter for all the prompts.

Read more ›



Creating a simple Java Web project with Maven – part 1

Java beginners to create a simple web application (i.e. a Web ARchive filei.e. a war file). Prerequisite is that you have set up Java, Maven, and Eclipse.

 Step 1: Execute the Maven maven-archetype-webapp command to create the Maven web structure with the following command on a DOS command prompt.

Read more ›



Creating a simple Java Web project with Maven – part 2 (Understanding war and pom.xml )

“Creating a simple Java Web project with Maven – part 1” covered developing a simple Java web application using Maven. This part is all about understanding the war and pom files. 1. The lib directory Q. … Read more ›...

Members Only Content
Log In Register Home


Creating a simple Java Web project with Maven – part 3 (with eclipse & m2e plugin)

“Creating a simple Java Web project with Maven – part 1” covered developing a simple Java web application using Maven. “Creating a simple Java Web project with Maven – part 2 (Understanding war and pom.xml)” elaborated on war and pom.xml. … Read more ›...

Members Only Content
Log In Register Home


Page 1 of 2
1 2

800+ Java Interview Q&As Menu

Top