Tuesday Aug 18, 2015

A new CDI scope in Java EE 8 ?

At this stage, it is probably safe to say that a new CDI scope will be introduced in Java EE 8 as the MVC Expert Group (JSR 371) is in the process of introducing a new CDI custom scope (@RedirectScoped) to support redirect. 

The idea is simple; an MCV controller can decide to redirect a client to a specific URL, to a specific controller method. A typical example would be that an anonymous user hits a page that required to be logged; the controller will then redirect the user to a login page. To do this, the controller uses HTTP 302 ('moved temporarily') to invite the client to make a new request to a different URL, to a different controller.  That second request implies a new (and thus different) request-response cycle. And that's the 'raison-d'être' of this new @RedirectScoped scope, i.e. to allow maintaining some state between the 2 request-response cycles of a redirect. Note that this new scope is for the MVC API only. That new scope is sometime referred as the 'Flash scope'. You can see how both redirect and @RedirectScoped works here.

The great thing about this new scope is that it is just a new CDI custom scope. This is a great example on how the Java EE Platform leverages its foundation to evolve. 

And last but not least, make sure to provide feedback as JSR 371 is in Early Draft period review.

Monday Aug 17, 2015

A Journey from Tapestry to JSF 2.2 and JavaEE 7

After the key Java EE 6 release we have seen a steady stream of folks migrating from various non-standard frameworks to Java EE - all for their own good reasons. One such very recent detailed migration story was shared by Lenny Primak. He successfully migrated from Tapestry to Java EE 7/JSF 2.2 and shared his observations in a series of (eighteen!) blog entries. His candid independent insights with regards to JSF/Java EE are likely very helpful to current and potential adopters.

I do think it is very important to take any such migration story with a grain of salt. All of this is just one person's view about what is right for them while choosing amongst a complicated set of trade-offs. It is never wise to over-generalize from those unique perspectives instead of choosing what is right for a given situation. We certainly should not forget that all non-trivial technology has it's advantages and drawbacks over time. Tapestry is a great technology in the overall ecosystem that standards like JSF do adopt good ideas from (and the opposite is likely to also be true). It is also possible to use Tapestry with Java EE as an alternative to JSF.

You can read Lenny's entire migration story on his personal blog. Although eighteen entries can seem daunting each entry is short/to-the-point and well written. Here are some highlights for the very impatient:

  • In the conclusion Lenny notes "As I looked at the big picture, it turned out to be easier to convert the whole app from T5.3 to JSF and PrimeFaces instead of T5.4, and that’s what I did. This turned out a great decision. Everything is compatible, future JavaEE versions are easily adoptable, all integrations do not require heroic efforts to implement or maintain and even JavaScript and Ajax with JQuery even started to be fun to develop."
  • Lenny opted to use Apache Shiro instead of built-in Java EE application server security such as GlassFish Security or WebLogic Security. He found that Shiro was easy to use with JSF and Java EE - "After the switch to JSF, however, Shiro, with it’s standard configuration, worked as expected, and I was able to build all of the security requirements in the application very quickly."
  • Lenny had some nice things to say about JSF generally and JSF 2.2 in particular - "The JSF way seems to be more flexible and saves code", "writing the same function in JSF and PrimeFaces took only about 10 lines of CoffeeScript code", "...major feature of JSF 2.2 is HTML 5 support, and ability to write JSF applications in standard HTML5 syntax as opposed to JSF tags...this development prompted me to re-evaluate JSF as my tool set".
  • Lenny found contributing to Java EE extremely easy "when trying to contribute to JavaEE, I was welcomed right away. The attitude really shined, and I was able to contribute valuable bug fixes without too much hassle."
  • Lenny found it more sensible to work with standard EJB 3 and JPA features instead of the Tapestry approach to persistence - "I found it better to call EJBs from Tapestry, and let EJBs handle all JPA transactions, thus totally bypassing Tapestry-JPA. This turned out to be the best solution of using JPA with Tapestry."
Do you have a similar interesting Java EE adoption story to share with the community? If so, please do reach out and we will find a way to properly highlight it.

Friday Aug 14, 2015

Submit Now to Win a Duke's Choice Award!

The incredible amount of innovation that uses and builds upon standard Java/EE technologies is one the most important factors that keeps our ecosystem so uniquely strong. The annual Duke's Choice Awards is a small way of recognizing and encouraging such innovation. Every year a panel of judges gives out ten of these awards at JavaOne. Submissions for this year is now open and you should check out the details right now.

Note that while some of the text uses the word "nomination", it simply means submitting (aka "nominating") your own project or work for consideration by the awards committee. There is no problem with doing this whatsoever and that is in fact what the submission form expects in most cases. That being said there is also no problem whatsoever in submitting on behalf of any project or work you think deserves the award even if you are not directly involved with it.

Besides some well-deserved recognition by the Java community, winners get a free JavaOne 2015 conference pass, a super cool Duke award statue and of course the winner's badge. Keep in mind the award isn't just for the framework or product developer types. In the past people using Java in innovative ways for "real world" projects, great educators and thought leaders have won too. Here are some example winners from the past few years for inspiration:

  • Apache TomEE - Innovative fully certified lightweight Java EE application server that is a drop-in replacement to Tomcat.
  • United Nations High Commissioner for Refugees/World Food Program Subsidy Card - A real world Java EE 7 application running on GlassFish that makes a real difference.
  • JCertif - Bringing Java/EE focused IT education to the African continent.
  • JEDI - Bringing Java/EE focused education to the Philippines.
  • DeltaSpike - A very useful CDI toolbox for Java EE developers.
  • Devoxx4Kids - A very cool initiative focused on teaching kid's programming facilitated by one of the largest Java developer conferences.
  • JDuchess - A program to strengthen women in Java.
  • London Java Community - The super active JUG involved in OpenJDK, JCP and Adopt-a-JSR.
  • Parleys.com - The world class e-Learning platform built on Java EE.
  • Arquillian - JUnit for Java EE, need I say more :-)?
  • jHome - An open source home automation platform built on Java EE and GlassFish.

You can check out all the past winners here. Do hurry up - the submission deadline is August 24. The submission form is here.

Wednesday Aug 12, 2015

Adopt-a-JSR/Java EE 8 at Istanbul JUG

The Istanbul JUG has been spinning up it's participation in Java EE 8 through Adopt-a-JSR. They have already taken an interest in MVC and JMS 2.1 with many more Java EE 8 JSRs on their radar. The Istanbul JUG is the first Turkish JUG to engage with Adopt-a-JSR and Java EE 8.

Towards this end, the JUG is hosting an event on Adopt-a-JSR to better involve JUG members. The intent of the meeting is to introduce the program and how members can participate in various Java EE 8 JSRs. The meeting will be held on August 13th, 7:30 PM at the Koc University Incubation center. Details of the meeting can be found here (the page is in Turkish and geared towards Istanbul residents).

The Adopt-a-JSR program is one the key things we are trying hard to do differently for Java EE 8 with the goal making this version of the platform one of the most community driven technologies ever developed. Here are just some of the things you could help do via the program right now:

The full details for Adopt-a-JSR/Java EE 8 is always available here. Remember that if you have any questions on any of this, you are always welcome to drop me a note.

Tuesday Aug 11, 2015

Maven, Java EE and ... NetBeans

At the beginning, build tools capabilities were relatively simple, i.e. mostly compile and package the compiled sources. But over the years, those capabilities have largely evolved (e.g. complex build processes, dependencies management, documentation generation, testing integration, etc.). And it's probably fair to say that Maven has been, at least in the Java landscape, one of the main actors in that evolution... if not the most important one! Maven is widely used since many years, it's now the de-facto Java build environment. And if you are using another solution (e.g. Graddle), you can't ignore Maven; chances are high that you still have to directly or indirectly use Maven in a way or another (e.g. to integrate a 3rd party framework which uses Maven). 

In his "Truly Unleashing the Power of Maven and Java EE" article, Geertjan Wielenga (NetBeans Product Manager) talks about how well integrated Maven is in the NetBeans IDE. If you haven't used NetBeans and its Maven support, you should read this piece. It's amazing how Maven is supported in NetBeans. It's so nicely integrated that you sometime tend to forget that Maven is used under the hood.

Geertjan then discusses another strength of NetBeans, its Java EE support. He then concludes with "Maven and Java EE are baked into the very essence of what NetBeans IDE is, as its heartbeat, and as its raison d’être". So when you combine NB's deep Maven integration with its outstanding Java EE support, you get a rock-solid (and free!) environment to develop Java EE applications.


Visual representation of a Maven project's depencies in NetBeans

Monday Aug 10, 2015

Help Recognize Java Community Process (JCP) Heroes!

An open standard like Java/EE involves a lot of hard work from a lot of different groups of people. The hard work of these people, largely selflessly, benefit countless developers. For specification leads the work in the JCP is often far beyond just a job. I have seen the same to be true of many vendor experts on a specification. Especially admirable are the independents that contribute to specifications largely on their own time as well as Adopt-a-JSR participants. The annual Java Community Process awards is a small way of recognizing some of these great people and their work. This year's award nominations are now open - you should read the details here. There are four different awards:

  • JCP member or participant of the year
  • Outstanding specification lead
  • Most significant JSR
  • Outstanding Adopt-a-JSR participant

The awards will be presented at JavaOne 2015. These are the nominations I have personally made already:

  • Josh Juneau (for outstanding Adopt-a-JSR participant)
  • Arjan Tijms (for JCP member of the year)
  • Adam Bien (for JCP member of the year)
  • David Blevins (for JCP member of the year)
  • Ivar Grimstad (for JCP member of the year)
  • Antoine Sabot-Durand (for outstanding specification lead)
  • Manfred Riem and Santiago Pericas-Geertsen jointly (for outstanding specification lead)
  • CDI 2 (for most significant JSR)
  • MVC 1.0 (for most significant JSR)
Are there others that deserve nomination this year? If so, please don't hesitate to submit the nomination yourself using the very straightforward form. The form is only open until August 17th, so please do hurry!

Friday Aug 07, 2015

JSF 2.3 Early Draft Needs You!

The JSF ecosystem continues to grow even after many years in a very competitive space. JSF 2.3 aims to keep the specification strong by addressing the needs of the community in the next few years and further beyond. The JSF 2.3 specification is now gearing up for it's first early draft. The intent is to publish the early draft by JavaOne 2015. If you have an interest in JSF 2.3, this is a perfect time to get involved in helping shape the draft. The items specification lead Ed Burns has in his mind at the bare minimum for inclusion into the early draft includes:

  • Multi-component validation.
  • Java SE 8 Date and Time support.
  • f:socket tag.
  • Option to render Ajax traffic using JSON.
  • Complete CDI alignment.
  • Any other open issues.

There are many ways for you to get involved as always. You are always welcome to join the expert group proper via the JCP page for the specification. You can always simply join the discussion by subscribing to the JSF 2.3 specification user alias. If you would rather participate as a group through your JUG you can do that easily via Adopt-a-JSR.

Wednesday Aug 05, 2015

JavaOne 2015 Java EE Track Content Finalized (A Detailed Preview)

I am very pleased to share with you that the JavaOne Java EE track content is now finalized. In this brief but detail-rich entry on my personal blog, I want to take this opportunity to tell you a little bit about the track, key content and star speakers this year. The collective passion and dedication of all the folks that submitted helped us construct a very strong offering for the community at large. JavaOne is a key part of the global Java community far beyond the walls of Oracle and all of you are a large part of keeping it successful.

I hope to see you all at JavaOne. In the next coming weeks and months we will be sharing more details on the Java EE track, content and speakers at JavaOne. Lastly having been on the other side of the fence I know as much as you might come to JavaOne, it might not be a practical reality for you for a variety of good reasons. I want to remind you that we make a point to make JavaOne content openly available to all. That being said I want to tell you that you should make the pilgrimage to JavaOne at least once as a Java developer.

Tuesday Aug 04, 2015

JSON-P 1.1 Early Draft Released!

The JSR 374 Expert Group has just posted the first Early Draft of the 'Java API for JSON Processing specification version 1.1' also known as 'JSON-P 1.1 EDR1'. 

This is the first cut of the JSON-P 1.1 API that is slated for inclusion in Java EE 8. The scope of any specification might (slightly) evolve, things might be removed and/or added. For example, the support of JSON Merge Patch wasn't originaly planned when this JSR was started but it is now part of EDR1. On the other hand, support for 'Big JSON' is still being discussed but again, it's a draft, the API will still evolve. 

At this stage, it is important that you read the Javadoc and try the API to provide feedback. There are still plenty of time to adjust things so feedback is really important. To easily get started on JSON-P 1.1, you might want to check those ressources.

On a practical note, the Javadoc *is* the specification so don't look for a PDF specification document. The Early Draft period will be closed on October, 2. In the meantime, the EG is eagerly awating your feedback! As usual, comments and feedback should be sent to the JSON-P users mailing list.

Friday Jul 31, 2015

Servlet 4 Early Draft Needs You!

HTTP/2 support via Servlet 4 is one of the most significant changes coming in Java EE 8. The Servlet 4 specification is now gearing up for it's first early draft. The intent is to publish the early draft by JavaOne 2015. If you have an interest in Servlet 4, this is a perfect time to get involved in helping shape the draft. The two items specification lead Ed Burns has in his mind at the bare minimum for inclusion into the early draft includes:

  • Support for HTTP/2 server push.
  • A decision to pursue or deliberately ignore the Reactive Streams concept.
  • Any open issues on the mailing list at the moment.
There are many ways for you to get involved as always. You are always welcome to join the expert group proper via the JCP page for the specification. You can always simply join the discussion by subscribing to the Servlet 4 specification user alias. If you would rather participate as a group through your JUG you can do that easily via Adopt-a-JSR.

Wednesday Jul 29, 2015

Java EE @ Voxxed Days Istanbul 2015

Voxxed Days Istanbul 2015 was held on May 9th. This was the first large scale independent Java focused conference ever to be held in Turkey. It attracted some of the best and brightest in the Java ecosystem including Gavin King and Arun Gupta not to mention local Java luminaries like Cagatay Civici (PrimeFaces lead) and Murat Yener (Java Champion). Topics included Java SE, mobile, NoSQL, methodology and of course Java EE. Indeed Java EE had a fairly strong presence at the event. I feel very privileged to be invited to this inaugural event. While in Turkey I am very happy to say I also spoke at two of the largest Java user groups in Turkey - the Ankara JUG as well as the Istanbul JUG.

At Voxxed Days I delivered talks on WebLogic, Java EE 8 and DDD/CargoTracker + Java EE. Others covered topics such as microservices + Java EE, Docker + Java EE, JSF and WildFly. At the Ankara and Istanbul JUGs I delivered demo driven workshops on Java EE 7. More details on the sessions and the trip to Turkey, including slide decks and code, posted on my personal blog.

Monday Jul 27, 2015

Ivar Grimstad's Java EE Sessions at JavaOne 2015

For the Java EE track at JavaOne 2015 we are highlighting some key sessions and speakers to better inform you of what you can expect, right up until the start of the conference.

To this end we recently interviewed Ivar Grimstad. Ivar is a Java EE advocate, speaker, blogger and open source hacker. He is a part of the Java EE 8 MVC and Security JSRs. We wanted to talk to him about his two accepted sessions at JavaOne 2015, his expectations for JavaOne and his experiences in the JCP (click here if you can't see the embedded video):

The following are the sessions we talked about:

Besides Ivar's sessions, we have a very strong program for the Java EE track and JavaOne overall - just explore the content catalog. If you can't make it, you can be assured that we will make key content available after the conference just as we have always done.

Thursday Jul 23, 2015

Some JSF news

The JSF Team has just released 2 updates of Mojarra (JSF Reference Implementation) : Mojara 2.2.12 (release notes, download) and the 3rd milestone of Mojarra 2.3.0 (release notes, download).

Mojarra 2.3.0 will be the JSF 2.3 Reference Implementation, which is targeted for inclusion in Java EE 8. So it is clearly 'work in progress' as the JSF 2.3 specification itself (JSR 372) is currently being worked-on.

It should also be mentioned the Arjan Tijms has been recently granted committer rights on Mojarra. There is no need to introduce Arjan as he is well known in the JSF eco-system, e.g. he is one of the 'faces' behind OmniFaces. In this interview, Arajn clarifies the relation between JSF, OmniFaces and PrimeFaces. In addition to JSF, Arjan is also a very active (and vocal) EG member of the 'Java EE Security' JSR (JSR 375). “Proficiat Arjan”; it's great to see community members being so involved!

Monday Jul 20, 2015

WebSphere Liberty Now Java EE 7 Compatible!

With the greatest pleasure I can report that IBM WebSphere Liberty 8.5 has recently been Java EE 7 certified! WebSphere joins the ranks of GlassFish 4, WildFly 8, Hitachi Cosminexus and TmaxSoft JEUS. With the very broad customer base that both IBM and WebSphere have globally this is very welcome news for Java EE 7 indeed. IBM has long been a very strong JCP supporter. They led the very well received Java Batch API included in Java EE 7 - bringing to bear their decades of deep expertise in mission critical batch processing. All of the Java EE certified offerings are always listed on the official Java EE compatibility page.

WebSphere Liberty is a modern, fast, lightweight and highly modular Java EE implementation. In fact using it's modular architecture WebSphere Liberty has been releasing parts of Java EE 7 into their fully supported service stream for a few months now (note that we've essentially done the same with WebLogic 12.1.3 during JavaOne 2014). Holly Cummins explains well the evolution of WebSphere Liberty and why it's a game changer especially for IBM customers. Liberty's approach to modularity makes it possible to upgrade to Java EE 7 incrementally without a reinstall and even continue running existing applications against a Java EE 6 runtime baseline. The Java EE 7 certification announcement from Laura Cowen can be found here and you can download WebSphere Liberty here.

As many of you know full Java EE 7 compatibility is one of the most significant goals of the upcoming WebLogic 12.2.1 release. The Apache TomEE team is also working on bringing forward Java EE 7 features. Judging by past history of release cycles for JBoss AS and JBoss EAP it's reasonable to think JBoss EAP will likely be Java EE 7 certified within this year (for those unaware WildFly is the upstream project for JBoss EAP much like JBoss AS once was). By the end of this year Java EE 7 users should have well over a half-a-dozen fully compatible platforms to choose from.

So the question now is who will be next to cross the Java EE 7 compatibility finish line - only to start working on their Java EE 8 implementation :-).

Friday Jul 17, 2015

Using HTML 5 with JSF 2.2/Java EE 7

Though some people seem to continue to pit JSF against HTML 5, there is little practical reason this needs to be the case. In fact JSF 2.2 specifically and Java EE 7 generally has gone to great lengths to support the fellow HTML 5 body of standards.

It has always been fully possible to use native HTML in JSF pages. There is little reason you would have any practical difficulty in using most key HTML 5 features even with JSF 2.1/Java EE 6 including canvas, web workers, audio, video and local storage. The only clear place where JSF and HTML 5 can collide is while mixing and matching JSF features with newer input/data elements and attributes such as calendar, email, pattern, autofocus and placeholder. The JSF 2.2 expert group created a very novel and easy solution to this problem through pass-through elements and attributes. Using this feature you can start with an HTML 5 native element and add JSF features to it or start with a JSF element and add HTML 5 features to it seamlessly and effortlessly. By far the best write-up on this capability comes from Chicago based Java EE community advocate Josh Juneau. You should take time to read his very well written article published on OTN as well as the Java Magazine.

Washington DC based Java EE community advocate David Heffelfinger will tackle the topic of pushing HTML 5 usage to the max with JSF 2.2/Java EE 7 in his accepted JavaOne 2015 session titled Integrating JavaServer Faces and HTML5. If you can't come to JavaOne 2015 to see him in person we will share the session video with you on this humble blog when it becomes available.