About this book

Web development – this is first of all a very non-concrete concept which can enclose everything what has to act with the Internet, from an easy HTML page up to a complicated application with a specialized client wired over the net to a server. In this book this concept refers quite specifically to the development of applications which are usable via browser with the undermentioned technologies. Therefore it becomes clear that it concerns not static Internet pages, but full applications which are hosted on a server and are available at any place, free Internet access assumed. This might be for example, a member’s management, an information system, a communication platform or other.

To realize such an application a whole bundle of apparently (or really) different technologies are necessary. First of all, from a user’s perspective, a browser is needed. This usually is third party software. A browser displays web pages provided via network by a server. A browser mainly understands markups like HTML and CSS. It might be enhanced by a client side language like JavaScript.

On the server side, we need a programming language to create our application. As the book title suggests, we use Java here. Since we don’t like to re-invent the wheel, we use an application server to host the applications and to provide a stack of Java Enterprise Edition (Java EE) features. JavaServer Faces is the first choice web framework discussed in this book. Beside that, we take a short look onto alternatives.

What is an application without data storage? Thus a persistence layer as well as a database system are required. A web application communicates with the user by means of forms and dialogs. The validation of inputs should be very fast so that the users can work without having to wait for lengthy reaction from the server. Therefore a part of the application, like input validation, is shifted to the client side.

In this book the web development takes place with these main technologies:

  • HTML (HyperText Markup Language) with CSS (Cascading Style Sheets) for representation in the browser
  • Java as server-side programming language
  • JavaServer Faces as web framework
  • Java EE 7 compliant application server
  • Java Persistence with SQL database
  • JavaScript for client side programming
  • AJAX as technology to update a page partly
  • Web services for the solution of special problems
  • Test frameworks and tools

In part I, we start with TinyCalculator. This is a very small application just to show some concepts of JSF. Following this “appetizer”, some basic concepts, like view definition language (VDL) or the JSF lifecycle are introduced.

Part II focus on Books. This is the application shown on the cover image. It’s used to show a list of reviews at it-rezension.de. This application uses templating, persistence (JPA) and context and dependency injection (CDI).

The biggest application Alumni is subject of part III. Alumni allows to organize former classes and upcoming events. We discuss authentication and authorisation as well as other security aspects. Re-usable components, testing and much more is explained.

Part IV covers additional techniques like web services. And we take a look onto Java based alternatives to JSF. One of them, AngularJS is a JavaScript framework. But we’ll use Java at the back-end.

The appendix offers you some extra chapters, like introduction into the basic concepts of HTML, CSS, JavaScript and more.

Sources of the applications are available for download at webdevelopment-java.info.

This book combines theoretical foundation with real applications. This denotes, beside explanation, you receive information from the practice. With so much screen-shots and source-code that you can understand the whole purely mental. It is not necessary that you sit down immediately in front of your computer and strike into the keys. Who would like, may do this naturally also. A detailed explanation follows the screenshots and listings in each case. This book is more concrete, without omitting however the theoretical foundation.

Albeit this book starts slightly a small example, it primarily addresses persons who already have programming knowledge in Java. Indeed, HTML and CSS belong in the repertoire of every web developer, but just with the entrance in this area some Java (mainly Java SE) developer may not have suitable knowledge. Hence, you find some accompanying information in the appendix as well as links on deepening information.

The main focus of this book is on the development of applications, not on the installation of the environment. Hence, the practical part also does not start with vast installation instructions.

Best of all you can understand of this book by means of NetBeans. You find this development environment under netbeans.org/downloads/index.html. Select there either the package “Java EE” or “All” and install this according to instructions. Prerequisite is an installed Java JDK. If you do not have installed this yet, then you’ll find a suitable link in the download area of NetBeans.

 

Conventions

 

During this book you’ll find a lot of useful links, pointing to further or additional information. All these links have been checked by the author at the time of writing. Since these links point to external resources that might be changed at any time by the appropriate content owner, a link might not be valid any more or does not point to the expected information. If you discover such an invalid link, please contact the author of this book to enable a correction.

 

Errors and typos

All information for this book have been faithful researched or developed. However, there can’t be any guarantee of being be error-free. If you discover errors or typos, please inform the author.

 

This book is written by Michael Müller and protected by copyright.

For your private, non-commercial usage, feel free to use your copy of this book and the downloadable source code.

For commercial or educational usage, please contact the author.