Java Reference
In-Depth Information
To create a GUI that uses only the REST API to communicate with our Java backend, we
will use a popular JavaScript framework: AngularJS ( http://angularjs.org/ ) . We won't get
into too much detail of the JavaScript code. The most interesting part for us is the usage of
our REST API, which we currently consume only in a Java application.
As seen in Chapter 5 , Combining Persistence with CDI , we will use WebJars. This time,
apart from Bootstrap, we need the AngularJS (preferably in Version 3.x) and Angular UI
Bootstrap package ( http://angular-ui.github.io/bootstrap/ ) :
<dependency>
<groupId>org.webjars</groupId>
<artifactId>bootstrap</artifactId>
<version>3.2.0</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angularjs</artifactId>
<version>1.3.0-rc.1</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>angular-ui-bootstrap</artifactId>
<version>0.11.0-2</version>
</dependency>
Note
Remember that all the files that are required to run this sample are available with the code
attached to this topic.
We will need an index.html file to start our work and an empty scripts directory to
store our logic. Our directory structure should currently look like this:
Search WWH ::




Custom Search