Monday Oct 12, 2015

Kito Mann's JavaOne 2015 Sessions on JSF, MVC and HTML 5

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 Kito Mann. Kito is a long time JSF advocate, popular author, speaker, consultant and very prolific contributor to the JCP. Just as previous years, Kito has one of the highest number of sessions from a single speaker on the Java EE track. He spoke to us about his accepted session at JavaOne 2015 (click here if you can't see the embedded video).

The following are the sessions we talked about:

  • Advanced PrimeFaces: This informal after-hours BoF is a deep dive into the popular PrimeFaces library. If you are using PrimeFaces this is a great session to really understand how PrimeFaces works.
  • Tuning JavaServer Faces: In this extended tutorial style session Kito offers his deep insight to effectively tuning JSF applications in the real world. I would say this is a must attend for any JSF user.
  • Building Professional JavaServer Faces UI Components: As Kito explains building reusable components is a key value proposition for JSF. In this informal after-hours BoF Kito will cover best practices for effectively building JSF components for real world applications.
  • Modern Web Apps with HTML5 Web Components, Polymer, and Java EE MVC 1.0: This is a very advanced technical session covering a number of very forward-looking topics. HTML5 web components are a key emerging standard for building JSF style components in vanilla HTML. Polymer is an important open source library for HTML 5 web components. In this session Kito shows how Polymer/web components can be used effectively with the upcoming MVC 1.0 standard slated for Java EE 8.

The following sessions are pretty closely related to what Kito is presenting at JavaOne this year:

Besides these 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. If you are coming, do make sure to book your sessions via schedule builder before they fill up.

Friday Oct 09, 2015

MVC 1.0 Second Early Draft Now Available

The MVC 1.0 specification slated to be included in Java EE 8 continues to make progress and just released a second early draft review (EDR). You can download and take a look at the draft from the JCP site. You can also test drive the reference implementation Ozark from it's own site.

Community momentum behind MVC continues to grow as well. Most recently the Bulgarian Java User Group hosted a workshop on the specification via Adopt-a-JSR. The workshop was led by Nayden Gochev and Ivan St. Ivanov. All the details including starter instructions and code for the workshop can be found on the JUG's site.

There are many ways for you to get involved or just send feedback 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 MVC 1.0 specification user alias. If you would rather participate as a group through your JUG you can do that easily via Adopt-a-JSR.

Monday Oct 05, 2015

Survey Confirms JSF Remains Leading Web Framework

In the past ten years or so few topics have caused as much impassioned debate as the question of what Java web framework to use. It's not too surprising then that JavaLobby/DZone recently ran a survey to see what the Java web framework usage landscape looks like today. You can take a look at the detailed results of the survey here. As the title of this blog entry suggests the results bode very well for JSF and in fact bode well for the MVC 1.0 specification targeted for Java EE 8 as well:

For those of us that understand something about how open standards and de-facto "standards" form it was only a matter of time before the obviously hyper-competitive server-side web framework space was going to consolidate/converge on some kind of market consensus. This survey clearly demonstrates that is exactly what is finally happening. JSF leads with 34.5% of the market share. That is great news for the JSF community and they deserve credit for it given most other Java web frameworks seem to implicitly choose JSF as their primary competitive target. Spring MVC follows very closely with 34.2%. This in my view is great news as this validates the need to standardize MVC 1.0 as an action-oriented approach to web frameworks. The MVC specification community should take note and pay close attention to the concepts proven out in Spring MVC. In addition the MVC specification has the implicit advantage of not being tied to legacy and starting from a clean slate to adopt what is proven and do better where it makes obvious sense. Other than the two front-runners market share drops pretty sharply for the rest.

I should note that the sample size for this survey is extremely strong at 1300+. While no survey is foolproof, this is probably the closest to getting at what is really going on in the Java web framework space. It is also note worthy that JSF has consistently been either number one or number two in such surveys in the past few years. OmniFaces lead Arjan Tijms pointed this out in a characteristically well written analysis on the JAX-RS expert group some months ago. I highly recommend the post for folks interested in JSF or Java web frameworks in general.

I know a segment of folks will have a tendency to dismiss the server-side Java web framework space with the hype around HTML 5/JavaScript rich clients like AngularJS. Fortunately DZone/JavaLobby ran an even broader reaching survey on the Java ecosystem. That survey measured server-side Java web frameworks against JavaScript client-side frameworks. The results were not made public yet but should be available soon. I don't consider myself a betting man but based on what I have observed during my popular talk on the topic of HTML5/JavaScript clients and Java EE 7 I have a few reasonably good guesses. Given the current hype I have no doubt JavaScript clients will make a strong showing. Indeed I would not be too surprised to also see that AngularJS already dominates the JavaScript client side framework space. However I think both the relative market share for JSF and Spring MVC will remain largely unchanged even in that survey. What's more likely is that the Java web frameworks that are already in a niche would join the marginal ranks of AngularJS's weaker JavaScript framework competitors. We will find out if I am right as soon as the results of the broader survey are published...

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.

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.

Thursday Apr 02, 2015

MVC 1.0 (JSR 371) Early Draft Review period has started!

MVC 1.0 (JSR 371) formally known as the 'Model-View-Controller Specification' has just entered the Early Draft Review period. This is significant because it is the first Java EE 8 specification to enter this phase. Kudos to the JSR 371 Expert Group! JSR 371 is ‘just’ a piece of the Java EE 8 story but this step shows that, slowly but surely, Java EE 8 is starting to take shape.

You are strongly encouraged to review the early draft of the specification, test it using Ozark, the open source JSR 371 Reference Implementation and obviously provide comments and feedback!

The MVC specification is really easy to grasp for anybody familiar with JAX-RS, the samples bundled with Ozark will also help to understand the specification. You can also check Ozark's sources and the presentation I gave a few days ago at JavaLand. 

To test the first Ozark milestone build, you need a recent GlassFish build (post 4.1 build, see here for details). Another and simple solution to test JSR 371 and Ozark is to use this script to create a Docker image with GF, Ozark and the JSR 371 samples pre-deployed.

The Early Draft Review period will end of April 30th. For specification related feedback, you can use the JSR 371 users mailing list or the JSR 371 issue tracker. For Ozark related feedback, please use the Ozark users mailing list or the Ozark issue tracker.

So what do you think of JSR 371? Also, should we use this Docker based approach to help you test other upcoming Java EE 8 specifications?

Thursday Mar 12, 2015

Templating in the MVC JSR

One of the underlying requirements of the JSR 371 was to not re-invent any VDL (View Declaration/Definition Language) because the Java EE Platform already provides that capability in 2 different forms, i.e. JSP and Facelets. In addition, the templating solution space is already very mature (and very crowded too!), it would be a complete waste to re-invent anything around that!

So instead of spending energy in re-inventing the (template) wheel, it makes more sense to spend energy in allowing to cleaning use, from the MVC API, the existing templating solutions provided by the platform: JSP & Facelets (see the javax.mvc.engine.ViewEngine interface). 

One additional benefit of that approach is that the MVC API is not limited to just JSP and Facelets. It will also be possible to cherry pick and easily plug-in your preferred templating solution to any MVC JSR implementation.

Next to JSP and Facelets, Ozark (JSR 371 Reference Implementation) already support some additional templating solutions: FreeMarkerVelocityMustacheHandlebars and soon Thymeleaf. Some of those were contributed by Rodrigo Turini and Rahman Usta.

Do you see any templating solution missing?

If so, it's probably just one contribution away!

Disclamier: it's early days, expect things to evolve!

Wednesday Mar 04, 2015


The MVC JSR (JSR 371) is progressing nicely. A key architectural decision was taken a few weeks ago: the MVC JSR will be based on JAX-RS. And since then, the Experts Group has started to publish SNAPSHOT builds :

If you want to lean more about the MVC JSR, make sure to bookmark this page where Manfred Riem (MVC co-spec lead) is tracking all relevant MVC information and resources.

It's still early but you now have everything on hand to start initial testing of this new API. As always, community feedback is a critical factor for the long-term success of this JSR!

Monday Feb 16, 2015

Manfred Riem Discusses JSF and Java EE MVC on JSF Central Podcast

Manfred Riem was a guest on the most recent JSF Central Podcast. For those unaware Manfred is the co-specification lead for both JSF 2.3 and Java EE MVC 1.0. Manfred talked about Mojarra, JSF 2.2, JSF 2.3 as well as MVC 1.0. The podcast is available here and you can read the transcript here.

The podcast is led by Kito Mann - well respected enterprise consultant, author, blogger and JSF community member. Kito has been a long time supporter of JSF with a long track record of contributing as a JCP standards group expert.

The newscast is in fact part of the JSF Central portal and covers topics of interest for the JSF ecosystem. Past contributors to the podcast have included folks like Ed Burns, Cagatay Civici, Neil Griffin, Lincoln Baxter and Shay Shmeltzer. All of the podcasts are archived here.

Besides the podcast, the JSF central portal itself is a very valuable resource for the JSF community you should explore. It does a very nice job listing JSF articles, books, projects, products and other resources.

Wednesday Feb 04, 2015

Java EE MVC to be Based on JAX-RS

One of the key Java EE 8 APIs, MVC 1.0 (JSR 371) is solidly moving forward. A key decision for the expert group to consider was whether to base the specification on Servlet or JAX-RS. MVC clearly has many semantic commonalities with both specifications such as HTTP method mapping, mime-type handling, session/request/cookie manipulation and so on. Specifications like JSF and JAX-RS are based on Servlet so it is not unnatural to base MVC on the foundational Java EE specification too. However basing MVC on the lower level Servlet specification would likely mean introducing many APIs that are potential duplicates of what is already available in the higher level JAX-RS API. On the other hand basing MVC on JAX-RS would mean significantly minimizing the possibility of API duplication. It would also mean the programming model between JAX-RS and MVC would be very similar, reducing the learning curve for both newcomers and experienced Java EE developers.

For these reasons it is not too surprising that the expert group has decided to move ahead by basing MVC on JAX-RS. MVC expert group member Ivar Grimstad shares the details including an early view on how the API may wind up looking like in a recent post. Do you have an opinion to share on this?

Thursday Nov 20, 2014

Tools for MVC in Java EE 8

Last week at Devoxx, Manfred Riem (MVC 1.0 Co-Specification Lead) did a session on MVC 1.0 (JSR 371) to a packed room. During the session, Geertjan Wielenga (Principal Product Manager in the Oracle Developer Tools) did a cameo appearance to discuss the tooling in the context of MVC. Amongst other things, Geertjan is looking at some of the potential features an IDE could bring to simplify the development of MVC based applications.  During the session, Geertjan did a demo based on a prototype he wrote for NetBeans. This demo was also using Manfred’s experimental action based prototype.

So clearly, it's early days! After all the MVC Experts Group has just started and is now discussing important orientations for the specification (e.g Should the Controller be based on the Servlet API or should it be layered on top of JAX-RS?). Nevertheless, it is interesting to follow Geertjan's explorations around tooling in that space.  This also demonstrates that adding new features to NetBeans is not necessarily a daunting task!

You can find more details on Geertjan's blog: Tools for MVC in Java EE 8 - Part 1 and Part 2.

Monday Oct 20, 2014

Why Another MVC Framework in Java EE 8?

Some of you may be aware that MVC 1.0 was launched as JSR 371. Targeted for Java EE 8 the goal of the JSR is to provide a standards based action-oriented web framework for Java EE. 'Why' and 'why now' are two perfectly reasonable questions to explore carefully with regards to this JSR. After all JSF has long been included in Java EE as a standards based MVC web framework. In addition although JSF is a component-oriented web framework there are myriad Java web frameworks that are action-oriented including ones that are very Java EE/CDI friendly such as VRaptor (indeed we had a session on VRaptor at JavaOne 2014).

There's little doubt the web framework space in Java has long been hyper-competitive. There are myriad camps each of which insist their way is the "right" way. Nonetheless in most reliable analysis two schools of thought have consistently come out on top for a number of years - component-oriented frameworks (led largely by JSF) and action-oriented frameworks (lately led by Spring MVC but long dominated by Struts). As a result it has been an open question whether Java EE should support both models much in the same way that .NET has done with ASP.NET and ASP.NET MVC. To put this question to rest we included it in the Java EE 8 survey. Despite all the factors above it turned out that the core Java EE community does in fact see the need to include a standard action-oriented web framework in Java EE, which brings us where we are with MVC 1.0. To answer some of the questions that should naturally arise none other than JSF specification lead Ed Burns put together a very nice analysis piece on OTN that's well worth a read. Red Hat's MVC 1.0 expert group representative Joshua Wilson has done the same as well.

It's obviously not  possible to construct an entirely unbiased pro/con analysis matrix for choosing between these two perhaps equally valid major approaches to Java server-side web frameworks. That being said I've tried to encapsulate some of the salient concerns in the graphic below.

I have years of real world development experience with both approaches in case you are wondering; I also favor JSF personally in case you were wondering but see both perspectives. In my view, component frameworks like JSF do extremely well in offering the closest approximation to Smalltalk's original MVC concept, reduce boilerplate to the bare minimum by almost entirely automating controllers/navigation/state handling/event dispatch and truly enable writing re-usable web components. These characteristics shine particularly bright with purpose-built component libraries like PrimeFaces that do a lot of the HTML, JavaScript, CSS heavy lifting for you. However because JSF is a higher level framework that cleverly abstracts away a lot of the underlying HTTP life-cycle there is an initial learning curve. In my view this leaning curve is fairly minimal with JSF 2+ and is only a serious problem with relatively inexperienced developers from a web-development heavy background and no desktop UI development experience.

Action-oriented frameworks try to accomplish far less in comparison. They provide a thinner MVC-like facade that leaves a lot of the work of writing controllers, HTTP handling, navigation, state maintenance, HTML/JavaScript/CSS authoring to the developer. There is really no concept of components beyond relatively elementary templating. As a result these frameworks do not generally have component or plug-in ecosystems. These characteristics make learning the framework easier for beginners that perhaps have a background in vanilla web development, PHP, JSP, ASP classic and the like. Because the framework does not alter the HTTP life-cycle or HTML rendering much it is easier to integrate arbitrary HTML, JavaScript and CSS tools.

To apply a very broad generalization the way I have seen this play out is that heavily form/workflow driven applications where Java developers do a lot of the UI work tends to be written in JSF. There are exceptions (such as eBay - they presented on their JSF usage at JavaOne 2014) but these applications usually reside behind corporate firewalls. More public facing web applications often dominated by web developers tend to be written using action-oriented frameworks.

I hope this helps answer some of the questions you may have had. JSF is here to stay and continues to have a strong community behind it. JSF 2.3 was launched as JSR 372 and is also targeted for Java EE 8. MVC 1.0 will join JSF as a first class peer in Java EE for folks that prefer an action-oriented web framework.

If either of these technologies strongly interest you and you have the time to spare, now is the time to apply to join the respective expert group. Note that you can always participate in a JSR without officially being part of the expert group by simply subscribing to the JSR user alias. Also remember that you can contribute on an even more lightweight format through Adopt-a-JSR.

Please note that any views expressed here are my own only and certainly does not reflect the position of Oracle as a company.

Tuesday Sep 23, 2014

MVC 1.0 (JSR 371) at JavaOne

In the early days... well... just a few weeks ago, the idea was to standardise MVC under the JAX-RS umbrella.  At that time, we didn't think to submit a JavaOne proposal for a dedicated MVC session. But since then, a lot of things has happened and MVC has now its own JSR (see here for some background).  

Fortunately, we were able to squeeze, the the JavaOne schedule, a dedicated MVC 1.0 BoF. This BoF will be hosted by Manfred Riem who is leading this new specification with Santiago Pericas Geertsen. It will take place on Tuesday Sep. 30 (7:00-7:45 PM) at the Hilton (Continental Ballroom 4), make sure to add it to your schedule!

Manfred is also co-leading JSF 2.3, you can see Manfred's JavaOne duties here.

Tuesday Aug 26, 2014


The Model–View–Controller (MVC) pattern has been used for several decades to implement user interfaces. And when it comes to MVC Web frameworks, those can be categorized as action-based or component-based. JavaServer Faces is a component-based MVC framework.

Through the survey, the community has expressed interest in an action-based MVC approach. Santiago Pericas-Geertsen has recently posted a draft proposal for a JSR ('MVC 1.0 JSR') that would define a MVC action-oriented framework for the Java EE platform. This MVC JSR is not intended to replace JSF (component-oriented) but offers, instead, a different approach to building Web applications on the Java EE Platform.

One of the goals of the MVC JSR is to leverage existing platform technologies where it makes sense (e.g. CDI and Bean Validation seems obvious candidates for the Model part).

The initial though was to define this (action-based) MVC framework in the JAX-RS specification but after initial feedback and discussions, the general consensus was that a separate JSR would be more appropriate. Technically, JAX-RS is still one of the option for the Controller part but everything is open and will have to be discussed in the EG. The outcome of those discussions might be that something else is needed for the Controller, or that there's a way to define a Controller independently of the underlying technology and JAX-RS would then be 'plugged' in, we will see... One thing is clear, defining a new template language is not in the scope of the MVC proposal!

We have strong team to lead the MVC JSR : Santiago Pericas-Geertsen (who is also the JAX-RS Specification co-lead) and Manfred Riem (who is also the JSF Specification co-lead). They will, for sure, get support from other community participants (e.g. Red Hat).

In terms of planning, Santiago is looking for supporters before he submits the proposal to the JCP. The JSR itself is aligned with the Java EE 8 planning.