Image for post
Image for post
The Best New Features in Java EE 8

The much-anticipated release of Java Enterprise Edition 8 boasts two exciting new APIs (JSON-Binding 1.0 and Java EE Security 1.0) and improvements to current APIs (JAX-RS 2.1, Bean Validation 2.0, JSF 2.3, CDI 2.0, JSON-P 1.1, JPA 2.2 and Servlet 4.0). This is the first release of Oracle’s enterprise Java platform for nearly four years and it contains hundreds of new features, updated functionality and bug fixes. So what are the best new features? I attempt to answer this highly subjective question in this blog post.

Java EE 8: Only What’s New

Image for post
Image for post

My new book Java EE 8: Only What’s New is currently available for only $9.95. …


Image for post
Image for post

All this week I am over at the CodeRanch answering questions about JAX-RS. Come and join me in the Web Services forum where I will be having fun discussions with other developers.

Win a 3-month Membership to Lynda.com

Ask me any question related to JAX-RS and you will be entered into a draw to win a 3-months access all areas membership to Lynda.com. Your membership gives you unrestricted access to 6,393 courses in Business, Technology and Creative Skills taught by industry experts. Among those courses are my four courses covering a wide range of Java EE APIs:

The promotion runs until 16th February 2018.


Image for post
Image for post

Overview of JAX-RS Annotations (Part 3)

This is a three-part series looking at the annotation that is used to implement REST endpoints.

In part one of JAX-RS annotations you learn about:

In this part, you will learn more about JAX-RS annotations. Are you ready, so let’s get started.

The @FormParam Annotation

You may need to read parameters sent in a POST HTTP requests directly from the body, rather than serializing it to an object. This can be done by using the @FormParam annotation.

@POST
@Produces(MediaType.APPLICATION_JSON)
public Response saveBookF(@FormParam("title") String title,
@FormParam("author") String author,
@FormParam("price") Float price) {
return Response.ok(bookRepository.saveBook(new Book(title, author, price))).build(); …

Image for post
Image for post

This is a three-part series looking at the annotation that is used to implement REST endpoints.

In part one of JAX-RS annotations you learn about:

In this part, you will learn more about JAX-RS annotations. Are you ready, so let’s get started.

The @Path Annotation (again) and @PathParam

As I am sure you have noticed the @Path annotation can be used on the resource method to further refined the location of a resource. In the above example, the path was specified as @Path(“isbn”). This is referred to as a path variable, which means that when a request is made to the URI /api/books/1234 the path variable 1234 is retrieved and assigned to the method parameter marked with the @PathParam annotation. …


Image for post
Image for post

The JAX-RS API forms an important part of the Java EE platforms commitment to provide standards-driven technology. The ubiquitous nature of the internet and that recent increasing interest in the microservice architecture has put more focus on small scalable autonomous services and their interoperability. The principal methodology used to allow microservice to communicate with each other and the ‘outside world’ is REST and its use in developing RESTful APIs and the technology that Java EE provides for this is the JAX-RS: Java API for RESTful Web Services.

The Goals of JAX-RS

The goals of the JAX-RS API are:

  • POJO-based
    To provide a collection of classes/interfaces and associated annotations to be used with POJOs so as to expose them as Web resources. …

Image for post
Image for post

Optimising Enterprise Java for Microservice Architecture

The Eclipse MicroProfile initiative was launched at JavaOne 2016, the brainchild of server vendors and Java user groups, in order to address the shortcomings in the Enterprise Java microservices space. The pace of Java EE releases slowed to a point where it was unable to meet the challenges of the rapidly advancing microservice trend. MicroProfile addresses this by brings together individuals, vendors and community organizations in open collaboration to deliver microservices to the EE eco-system.

What is Eclipse MicroProfile?

The MicroProfile specifies a collection of Java EE APIs and technologies which together form a core baseline microservice that aims to deliver application portability across multiple runtimes. …


Image for post
Image for post

Recently there was an interesting discussion on the use of predicate negation in the .filter method on a stream by members of the LJC mailing list, so I thought it would be worth summarizing it in a blog post. The discussion was about ways to use .filter and to negate the predicate.

Code for this post is available in my GitHub account.

Question: How can you use .filter to negate the predicate

This is perhaps how you might think about doing,

Stream.of(1, 2, 3, 4, 5, 6, 7)
.filter(((Predicate) c -> c % 2 == 0).negate())

but here are some alternative ways.

Answer 1: Write a predicate utility method

You can simplify this by writing a utility method that performs the negation. …


Image for post
Image for post

Java EE 8 was launched at JavaOne 2017 in October and is already proving popular. It boasts two new APIs: JSON Binding API and Java EE Security API, three major updates: Servlet 4.0, Bean Validation 2.0, CDI 2.0 and minor updates: JAX-RS 2.1, JSF 2.3, JSON-P 1.1. To find out more read my article What’s new in Java EE 8 over at IBM developerWorks.

Every day I will send out a new challenge about a feature of Java EE 8 and publish the question and answer on my blog readlearncode.com.

How to Take Part

Reply to a Challenge Tweet

If you would like to take part just follow the tweeter hashtag #100DaysOfJavaEE8 and post a reply with an answer to the challenge. …


Get Started with Context and Dependency Injection

In this article, I will give an overview of some of the fundamental concepts and usages of the Context and Dependency Injection framework.

You will learn that all you need to use the dependency injection framework is a compliant POJO and a qualifying injection point and that any object, including Collections, can be made injectable.

You will discover how to mark a bean so that it can be used by Expression Language to bind data directly in JavaServer Faces (JSF) and you will discover how to disambiguate a bean using the @Qualifier annotation.

You will learn about the scoping of a bean’s lifecycle and how it matches with HTTP scopes and view related scopes and discover how to mark a bean so that it can be used by Expression Language to bind data directly in JavaServer Faces (JSF) and JSP views and I finish talking about Type Safety, Scopes and the extensibility of CDI. …


In this article I look at JSF 2 and how it fits into the Java EE ecosystem.

When building a web application we provide the end user with a way to interact with our application and this is what JSF provides.

I will introduce you to the MVC design pattern and how to use it and you will discover the Facelets view language and how it is used, how data and events are bound to the context and how this is achieved via expression language.

I will explain how AJAX is natively supported and just how pluggable the eco-system is by looking at alternative templating frameworks such as Primefaces. …

About

Alex Theedom

I share my knowledge of Java EE via my blog readlearncode.com, my book Java EE 8: Only What’s New leanpub.com/javaee8 & my Java EE courses on lynda.com.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store