Since version 9, Java has new features every 6 months and it’s very hard to keep track of these new changes. Most of the information on the internet describes changes between the last 2 Java versions. However, if you’re in a similar situation as me, you’re not using one of the latest Java versions but a version several releases older.

Then it’s useful to know which new features were added since the version you use now, or between the versions that you use now and the one you want to start using next. Therefore I’ve compiled a table with all new features added since Java 8 for each new Java version and I keep it updated for every newer Java version.

(more…)

Threads, concurrency, or synchronization are not very easy to understand concepts. When some concurrency is involved in our applications it’s pretty hard to avoid making mistakes. Although Java provides mechanisms to deal with parallel programming, sometimes there are just too many options. And often some essential options are missing. For web applications, Jakarta EE provides a simplified programming model to deal with parallel tasks. But in order to use it effectively and avoid mistakes, you need to understand the basic concepts which I’d like to explain here.

(more…)

The security before Java EE 8 / Jakarta EE 8 used to be a bit complicated and confusing. Every specification provided its own way to retrieve information about the logged-in user. The situation greatly improved with the introduction of the Security API that provides a unified way to do that – simply inject the SecurityContext CDI bean.

(more…)

Jakarta REST (JAX-RS) defines it’s own dependency injection using the @Context annotation. REST resources also support CDI injection if you enable CDI on the REST resource class (e.g. using a bean-defining annotation like @RequestScoped).

But injection doesn’t work out of the box on JAX-RS sub-resources. How to create sub-resources so that both injection mechanisms work also in sub-resources? I’ll show you, it’s very easy.

(more…)

Recently, we had a discussion how to create a standalone Jakarta Batch test kit (TCK). For most of the committers, it’s pretty natural to use Arquillian to abstracts tests away from how they are executed on an implementation. But Romain proposed an intriguing idea to use plain JUnit5 that got me thinking. And it didn’t stop with thinking. After a few hours of hacking, I’m now able to present a proof of concept and suggest how we could use plain JUnit5 for the TCK and also how containers can be integrated with it using good old Arquillian to avoid reinventing the wheel.

(more…)
This entry is part 1 of 1 in the series Java EE 8 Microservices

Services can often be optimized with asynchronous processing even without changing their behavior towards the outside world. The reason why some services aren’t efficient is that they need to wait for other services to provide a result to continue further. Let’s look how to call external REST services without waiting for them and also do multiple parallel calls independently and combine their results later with a reactive pipeline in Java EE 8.

(more…)

As a Java EE developer, I sometimes envy how fast it’s possible to see the result of a code change in a running application with interpreted languages like PHP or JavaScript. With Java, it’s always necessary to rebuild the source code in a bytecode, which can be then safely updated only by restarting the whole application. And all developers know that restoring the desired state of the application after a fresh restart takes time and is tedious. A while ago I’ve come across an opensource tool called HotswapAgent that speeds up code reloading. (more…)

Java EE 7 is around for a few years already, and provides several very useful and long-awaited features, like entity graphs and better support for stored procedures and results mapping. For an overview, have a look at Thorben Janssen’s blog post. The query capabilities were also enhanced, with 3 additional keywords. All of them are available in both JPQL and Criteria API:

  • ON keyword to specify conditions for JOINs
  • FUNCTION to call arbitrary database function
  • TREAT to downcast entities to their specific type

In this post, I’ll focus on the first of them – the ON keyword in JOINs.

(more…)

MVC 1.0 is an action-based Model-View-Controller web framework, which will be a part of future Java EE 8. It will live side by side with component-based JSF framework and will provide an alternative for building HTML+javascript oriented applications with full control over URLs.

This post summarizes what needs to be done in order to use Facelets instead of default JSP as a view technology for MVC framework.

(more…)

This site uses cookies to improve your experience. By using this site you agree to these cookies being set. More in our cookies policy

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close