Java EE 8 and Angular

This is the code repository for Java EE 8 and Angular, published by Packt. It contains all the supporting project files necessary to work through the book from start to finish.

About the Book

The demand for modern and high performing web enterprise applications is growing rapidly. No more is a basic HTML front-end enough to meet customer demands. This book will be your one stop guide to build outstanding enterprise web applications with Java EE and Angular. It will teach you how to harness the power of Java EE to build sturdy back ends while applying Angular on the front end. Your journey to building excellent web enterprise applications starts here!

Instructions and Navigation

All of the code is organized into folders. Each folder starts with a number followed by the application name. For example, Chapter02.

Chapters 1, 3, and 12 do not have codes

The code will look like the following:

@NgModule({
  declarations: [ AppComponent, PositivePipe ],
  exports:      [ AppComponent ],
  imports:      [ BrowserModule, AppRoutingModule ],  
  providers:    [ DashboardService ],
  bootstrap:    [ AppComponent]
})
export class AppModule { }

The book is being written considering Java EE 8 and Payara. But a compatible/stable version of Payara for the latest EE 8, hasn't been released yet. So the code has been verified against Payara Micro 5 Alpha releases (https://www.payara.fish/upstream_builds)

Specific instructions

With the repository cloned or downloaded, navigate to the chapter for building and running the projects.

Chapter 2

cdise-starter Within the project run: mvn clean install This downloads the dependencies and runs the single JUnit Test for CDI.

Open the project and browse and run these classes

cdise-jpa-starter

Within the project run: mvn clean install
Browse code starting with class App.java

jpa-validation-starter

Within the project run: mvn clean install

Run project on Java EE 8 Server such as Payara 5 and observe output (Ignore the DROP TABLE exceptions)

Browse code under package org.jee8ng.jpa.validation.starter which demos validations

Chapter 4

payara folder has 3 projects Within each project run: mvn clean install

Then run each project as independent process using payara-micro-xxx.jar (xxx is version of latest server downloaded).

java -jar payara-micro-xxx.jar --deploy ims-micro-users/target/ims-microusers.war --port 8081

java -jar payara-micro-xxx.jar --deploy ims-micro-tasks/target/ims-microtasks.war --port 8082

java -jar payara-micro-xxx.jar --deploy ims-micro-notify/target/ims-micronotify.war --port 8083

Running with Docker

ims-micro-users (Uses Payara Micro base image)

ims-micro-tasks

Create the runnable jar and then next create Docker container image using it.

spring folder

issue-manager-users - Maven example of Spring Boot Microservice project

mvn spring-boot:run

swarm folder

issue-manager-users - Maven example of Wildfly Swarm Microservice project

mvn wildfly-swarm:run

Chapter 5

Chapter 6

Sample code to browse JAXRS features

jaxrsdemo

Chapter 7

Build ims-security first by going to the project folder and running: mvn clean install

Next run these commands to get the project up and running.

You can either play around with Postman or curl with the REST APIs or startup the Angular IMS app.

Chapter 11

Running the Angular IMS Application locally. This depeneds on Chapter 7 (backend).

Run npm install from ims-ui project folder. Run ng serve --open from ims-ui project folder

Two accounts would be setup already:

Account: Admin Username: admin Password: admin

Account: Guest Username: guest Password: guest

Chapter 13

This depeneds on Chapter 7 (backend).

Build project using mvn clean install

Chapter 14

This library gets used in Chapter 7 code as well.

Build project using mvn clean install

Related Products