Saturday, 14 September 2013

Develop your own web application

This article is the first part of a three-part series, and it will demonstrate how to use Java EE 7 improvements and newer Web standards such as HTML5, WebSocket, and JSON processing to build modern enterprise
applications.

In this part, we will see in detail how to use NetBeans IDE 7.3 and  GlassFish 4 to build a complete three-tier end-to-end application using
the following technologies, which are built into Java EE 7:
■ Java Persistence API (JPA)2.1 (JSR 338)
■JavaServer Faces (JSF) 2.2(JSR 344)
■Contexts and DependencyInjection (CDI) 1.1 (JSR 346)

Note: The complete source code for the application designed in this article can be downloaded here.
What Is Java EE?
Java Platform, Enterprise Edition (Java EE) is a dedicated Java platform for developing and running enterprise applications. Java EE provides all you need to create large-scale, multitiered, scalable, reliable, and secure network applications  for business.
Prerequisites
Enough explanation is provided here to get you started with the sample application; however, this article is not a comprehensive Java EE tutorial. Readers are expected to know about basic Java EE concepts, such
as Enterprise JavaBeans (EJB), JPA, and CDI.

Download and install the following software, which is used to develop the application :
■ JDK 7
■ NetBeans IDE 7.3 or higher “All” or “Java EE” version
■GlassFish 4.0 b80

Create a Real-Life Enterprise Application with NetBeans IDE 7.3
In this practical section, we will build a real-life Java EE 7 enterprise application step by step so that you can learn quickly the basics about the
new and important timproved in Java EE 7, such as JPA
2.1, JSF 2.2, and CDI 1.1.


What we are going to do is create a typical three-tier Java EE 7
Web application that allows customers to view the show times for a movie showing at a seven theater Cineplex and then to make reservations.

Specifically, we will perform the following tasks:
■ Install and configure GlassFish and NetBeans IDE 7.3.
■ Load a sample Maven application by following the instructions and guidance.
■Review the configured datasource and generate database artifacts, such as tables.
■ Create the Web pages that allow a user to book a particular movie show in a theater.
■ Add and update existing code in order to demonstrate the usage of different technology stacks  in the Java EE 7 platform.
■ Run and test the sample application.

Install and Configure NetBeans IDE 7.3 and GlassFish 4
Let’s establish our development environment by downloading and installing the latest version of NetBeans IDE and GlassFish.
1. Download and install the latest version of NetBeans IDE:
a. Download the All or Java EE version of NetBeans IDE 7.3 or higher.
b. Follow the installation instructions here.
2. Download the GlassFish server and configure it in NetBeans IDE. To be sure we use GlassFish as our application server, we are going to specify it in NetBeans IDE:
a. Download GlassFish 4.0.
b. Unzip the compressed file in the location where you want the glassfish4 folder to be placed.
c. Open NetBeans IDE and clickthe Services tab.
d. Right-click Servers and then choose Add Server, as shown
e. Select GlassFish Server 3+ in the Add Server Instance wizard,
f. Type GlassFish4.0b80 in the Name field, and click Next.
g. Click Browse, browse to the location where you unzipped the GlassFish files, and select the glassfish4 folder.
h. Click Finish.

Bravo! Now your environment is ready for fun. Continue reading this blog for further Instructions


No comments:

Post a Comment