background preloader

JAVA EE

Facebook Twitter

OpenClassrooms - Créez votre application web avec Java EE. La création d'applications web avec Java EE semble compliquée à beaucoup de débutants. Une énorme nébuleuse de sigles en tout genre gravite autour de la plate-forme, un nombre conséquent de technologies et d'approches différentes existent : servlet, JSP, Javabean, MVC, JDBC, JNDI, EJB, JPA, JMS, JSF, Struts, Spring, Tomcat, Glassfish, JBoss, WebSphere, WebLogic... La liste n'en finit pas, et pour un novice ne pas étouffer sous une telle avalanche est bien souvent mission impossible ! Soyons honnêtes, ce tutoriel ne vous expliquera pas le fonctionnement et l'utilisation de toutes ces technologies.

Car ça aussi, c'est mission impossible ! Il faudrait autant de tutos... Non, ce cours a pour objectif de guider vos premiers pas dans l'univers Java EE : après quelques explications sur les concepts généraux et les bonnes pratiques en vigueur, vous allez entrer dans le vif du sujet et découvrir comment créer un projet web, en y ajoutant de la complexité au fur et à mesure que le cours avancera. Java - pass ResultSet from servlet to JSP. How to get JSON object from HTTP request in Java. Java - get json from HttpResponse. Parsing a JSON from HTTP Response in Java.

JSON with Java. This chapter covers how to encode and decode JSON objects using Java programming language.

JSON with Java

Let's start with preparing the environment to start our programming with Java for JSON. Environment Before you start with encoding and decoding JSON using Java, you need to install any of the JSON modules available. For this tutorial we have downloaded and installed JSON.simple and have added the location of json-simple-1.1.1.jar file to the environment variable CLASSPATH. Mapping between JSON and Java entities JSON.simple maps entities from the left side to the right side while decoding or parsing, and maps entities from the right to the left while encoding.

On decoding, the default concrete class of java.util.List is org.json.simple.JSONArray and the default concrete class of java.util.Map is org.json.simple.JSONObject. Encoding JSON in Java Following is a simple example to encode a JSON object using Java JSONObject which is a subclass of java.util.HashMap. HttpClient - HttpClient Tutorial. Overview This tutorial is designed to provide a basic overview of how to use HttpClient.

HttpClient - HttpClient Tutorial

When you have completed the tutorial you will have written a simple application that downloads a page using HttpClient. It is assumed that you have an understanding of how to program in Java and are familiar with the development environment you are using. Getting Ready The first thing you need to do is get a copy of HttpClient and its dependencies. Once you've downloaded HttpClient and dependencies you will need to put them on your classpath. Concepts The general process for using HttpClient consists of a number of steps: Create an instance of HttpClient. We'll cover how to perform each of these steps below. Upon the connection release HttpClient will do its best to ensure that the connection is reusable. It is important to always release the connection regardless of whether the server returned an error or not.

Instantiating HttpClient HttpClient client = new HttpClient(); Creating a Method Execute the Method.