Java EE

Java EE

Java platform, Enterprise Edition (Java EE) is the industry standard for enterprise Java computing. With new features that enhance HTML5 support, increase developer productivity, and further improve how enterprise demands can be met, the Java EE platform enables developers to write less boilerplate code, have better support for the latest web applications and frameworks, and access enhanced scalability and richer functionality.

The Java EE platform encompasses a range of specifications that deal with everything from database access to business logic encapsulation to security to frontend development. Go to the following URL for full details and a complete end-to-end tutorial: http://docs.oracle.com/javaee/7/tutorial . A simple end- to-end scenario that uses Maven and Java Server Faces (JSF), as well as RESTful Web Services and JavaScript, is provided in the next chapter.

To get started creating Java EE applications, go to File ➤ New Project (Ctrl+Shift+N). The New Project wizard opens, shown in Figure 4-8 . If you are unfamiliar with Maven and are primarily focused on learning the Java EE platform, your entry point will probably be Java Web ➤ Web Application in the New Project wizard. However, if you want to work with Maven and you do not already have a Maven-based project, start with Maven ➤ Web Application, as shown in Figure 4-8 .

Figure 4-8. Getting started with Java EE projects

If you already have a Maven-based application on disk, that is, an application that includes a POM file, simply go to File ➤ Open Project. The IDE understands the POM file automatically and lays out your application in the IDE in a logical manner. The POM is further supported in a variety of ways. Open the POM by double-clicking on it and notice that the IDE shows you the effective POM, the source of the POM, as well as a graph view that shows the dependencies between the JARs registered in the POM.

Next, you are likely to want to create new files soon after you have set up your project. To do so, go to File ➤ New File in the IDE and, in particular, explore the Persistence and Web Services categories, shown in Figure 4-9 .

Figure 4-9. Getting started with files in Java EE projects

You will quickly see that in addition to helping you create simple Java source files, the IDE provides advanced code generators. Starting from a database or from one or more entity classes that conform to the JPA specification, the IDE can generate many artifacts for you. The code generators, such as the ones shown in Figure 4-9 , are made possible by the fact that the artifacts are based on the specifications that are part of the Java EE platform. Specifications enable tool providers, such as the IDE, to know upfront the structure and content of files and other artifacts that need to be created. For example, if you want to expose the data in your database via RESTful Web Services, which are based on the JAX-RS specification, you simply need to step through the RESTful Web Services from Database wizard, shown in Figure 4-9 . Explore the other code generators, read the descriptions, and notice how they relate directly to the specifications that the Java EE platform makes available.