Wednesday Sep 10, 2014

In this new article, JavaServer Faces (JSF) spec lead Ed Burns explains two kinds of model view controller (MVC) as part of the JSF framework. The article's goal is to show the continued commitment to JSF evolution and to clarify the complementary usages of these two view technologies.

The two kinds of MVC in question are UI component oriented MVC and action oriented MVC. This article first goes over these two different styles of MVC, then explains the rationale for filing a separate JSR for MVC 1.0 and explains how this new specification will relate to the next version of JSF.

Monday Apr 21, 2014

PrimeFaces, a popular JavaServer Faces (JSF) UI framework, can be used to quickly develop sophisticated applications for the enterprise or for standard websites. The OTN tech article PrimeFaces in the Enterprise focuses on how to efficiently build data-driven applications for the enterprise. Developer Josh Juneau builds an enterprise application, making use of PrimeFaces to create a user-friendly, robust experience. He walks you through developing forms to input and update customer, job, and pool information for the fictional AcmePools company. See how PrimeFaces can be included in JSF applications to significantly increase the options available for your applications.

Wednesday Sep 25, 2013

Adam Bien, who is not only a Java Champion and JavaOne Rock Star, but
was named in 2010 as Oracle Magazine’s Java Developer of the Year, spoke
to an enthusiastic crowd where he addressed some core issues about Java
EE. He encouraged questions – “The more heretical or offensive the
better.” It was obvious that Bien loves to think about and code in Java.
He remarked, “The more I code the happier I am”. Spoken like a
hard-core Java developer!

First, he asked, “What is Java EE?
Innovation vs. Standardization”? For Bien, Java EE is nothing but a
release of co-existing APIs. Before Java EE, there was a mess with lots
of application servers, with absolutely no chance of finding two
application servers with similar APIs. Java EE resulted in a huge
simplification. Now with Java EE 7 a wealth of are applications
available. Java EE, insisted Bien, was never about innovation because
building a standard precludes innovation. “Java EE will always lag
behind,” he observed. “For instance, Hibernate will always have more
features than JPA. Spring will always have more features than CDI. Java
EE is the 80% that makes products work. It was never about innovation.”

He
boiled down the whole point of Java EE: “What matters are small WARs –
the smaller the WAR, the faster the build and deployment. The faster the
build and deployment, the more productive you become,” he insisted. He
explained that Java EE enables you to not put everything into the WAR
and place as much as possible on the application server and less on the
WAR. He explained that most of his WARs in Java EE 6 or Java EE 7
projects are very small

Bien asked, “Are EJBs bloated?” He
explained that the question implies some voodoo stuff behind the scenes
making EJBs bloated. He offered a means to answer this question.

He went on to answer a wealth of questions in a way that was thoughtful, incisive, witty and, at times, a bit provocative.

Here's some of the topics/issues (pulled directly from his slides) that Adam touched on in this fast-paced session:

*Do we need transactions?*Is Dependency Injection Black Magic, VooDoo, or both?*Is EJB pooling needed? Are EJBs bloated? What happens, if you violate the EJB programming restrictions? *Why AOP didn't take off in Java EE? *Stateless vs. Stateful programming model? *HA without a Cluster? *Are there any POJOs out there? What happens during deployment? *Is Java EE faster than J2EE? Does JMS 2.0 scale and perform well? Is Java EE only suitable for the "big" enterprise? *Is JSF the silver bullet? What is the deal with CORBA and RMI? *How to unit test Java EE applications? Why we don't build a best of breed server from scratch?

This
was a lively, entertaining and information-packed session. Just what
you would expect from a pro developer as Adam Bien. I highly recommend
viewing this session.

Adam Bien’s BlogCheck out Parleys.com where you can listen to the session in early October.

Tuesday Sep 24, 2013

Ed Burns, Consulting Member of Technical Staff, and Kinman Chung,
Principle Member of Technical Staff, both at Oracle, presented a session
on Monday in which they described new features in JSR 341, Expression
Language (EL) 3.0. They discussed the APIs for the use of EL in
standalone environments and EL syntax for new operators, plus lambda
expressions, and support for collection objects, all the while offering
copious code illustrations.

Burns remarked that he was pleased
that Java Champion and JavaOne Rock Star Adam Bien had referred to EL
3.0 as “the hidden gem of Java EE”. “I don’t know how hidden it is,”
said Burns, “but I think it’s a gem.”

He discussed the origins
of EL, which has a long and active history in the Java platform. EL
began in 2004 as part of the Java Standard Tag Library (JSTL 1.0), moved
to JSP 2.0 in 2006, and became an independent specification with JSR
341 in 2011. It is used in JSF, CDI, and Avatar. Now, 9 years after its
inception, it is an independent specification that is heavily used in
JSF.

Burns observed that the presence of EL is the key
differentiator between Java server and non-java server stacks. “Java
server-based web frameworks are likely to use EL,” said Burns. “When you
show someone who is not familiar with EL how easy it is to move things
together from disparate parts of your application, it’s very
compelling.”

The most important feature that EL 3 brings is
lambda expressions – developers do not have to wait until Java SE 8 is
released. It all runs on Java EE 7, which requires Java SE 7 -- which
means that it is currently available. Burns gave a brief discussion of
lambda expressions, which basically behave like an anonymous function --
lambdas in EL are EL expressions. They offer full access to the EL
environment within the body of the EL lambda expression, something not
available from Java SE lambdas. “You won’t be able to refer to other EL
things from a plain old SE lambda expression,” said Burns.

The
goal of EL 3 is to provide greater expressive power for applications and
to use it outside of Java EE. Burns and Chung provided an overview of
collection operations and explained EL’s support for stand-alone
environments. EL 3 is easy to use outside of Java EE and provides
standard data structures: ELContext; ELResolvers; and local variable and
function repositories.

They explained that it enables direct EL
operations and has: EL expression evaluation; Bean definition; and
Function definition. They emphasized that other key parts of Java EE can
also be used standalone, such as: Bean Validation; Persistence (JPA);
and Contexts and Dependency Injection (CDI). They encouraged developers
to consider the possibilities for cloud deployment in: Defining
functions and variables and defining beans.

They spent the rest of the session illustrating their key points with a healthy dose of code.

Friday Mar 08, 2013

Today is International Women's Day and Global Tech Women founder Deanna Kosaraju commemorates the event by organizing the Voices Global Conference, a live streaming event celebrating women in technology. Women technologists from over 20 countries present a collection of technical talks including software for data center, testing, breakthrough innovation frameworks, community building, humanitarian projects, leadership, and more. Attendees can participate in group discussions, network online or at local gatherings, and watch the sessions online. All the sessions are streamed live and recorded. Registration is open.

Another conference starting today is Java Developers Conference (JDC) in Cairo, Egypt. The conference brings together 600 developers and students for the biggest Java conference in Middle East and North Africa today and tomorrow. The Egyptian Java User Group (EGJUG) is organizing the two-day forum for knowledge exchange with its 4 tracks and 40 sessions in English and Arabic.

Also this weekend, Daniel Sachse is organizing a Google hangout hack night Saturday March 9, 2013 at 10:00 a.m. PST. Participants are expected to contribute to a JSR about Java EE technologies such as CDI and JSF among others.

Friday Feb 22, 2013

Oracle’s Java evangelist and noted Java EE expert, Arun Gupta, presented a session at the annual IOUC (International Oracle User Community) Summit, held January 14–16, 2013, at Oracle headquarters in Redwood Shores, California, where more than 100 top user group leaders from around the world gathered to share best practices, provide feedback, and receive updates from leading Oracle developers.

Gupta’s talk, titled "The Java EE 7 Platform: Higher Productivity and Embracing HTML5," presented a glimpse into the rich possibilities that will be available in Java EE 7 upon its release in the spring of 2013. He covered several major developments, including:

Gupta focuses on ways in which Java EE 7 offers higher productivity; less boilerplate; richer functionality; more default options; and HTML5 support in the form of WebSocket and JSON. He also observed that the cloud is in need of more standards. From the article:

"There are not enough standards in the cloud with W3C and other standards bodies. More standards are needed so that we can define a Java API for the cloud. Premature standardization can also be a problem if not enough innovation has taken place. So what is the right thing for the platform? We have reached out to the community, the core group members, and the executive committee of the Java Community Process and have focused on providing higher productivity and on embracing the HTML5 platform more closely. We are going to use dependency injection a lot more, which will give developers the ability to write less boilerplate code and offer richer functionality such as batch applications and caching. Similarly, for HTML5, we are embracing WebSocket functionality and the ability to parse and generate a JSON structure. We are providing support for HTML5-friendly markup as part of JSF.”

Gupta summarized the strengths of the various JSRs and closed by encouraging developers to participate in Adopt-a-JSR, a project that enables them to, “pursue their interest in particular Java EE 7 JSRs and download code, play with it, report bugs, and offer feedback to Java EE 7 specification leads.”

Tuesday May 15, 2012

Part Two of Deepak Vohra’s “JSF 2.0 for the Cloud” is now up on otn/java. In Part One, Vohra demonstrated how to take advantage of resource handling, @ManagedBean annotation, and implicit navigation. In Part Two, he explores new features in JSF 2.0 that make it ready for the cloud, including Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Ajax support for JSF 2.0 components includes asynchronous transfer of data between a client and a server, along with partial page rendering, partial page processing, and grouping of components, and can be added using either f:ajax tag or the JSF Ajax library (jsf.js).

Regarding view parameters, Vohra explains, “JSF 2.0 added support for view parameters, which add the provision to send request parameters in a GET request. A view parameter is a UI component represented with the UIViewParameter class. Just like other UI components, it is saved in the UI component tree for a Facelets page and can be associated with validators and converters. A view parameter is an EditableValueHolder because it implements the interface.”

Preemptive navigation allows developers to determine the resource file that they navigate to and request parameters, if needed, based on the navigation case and view parameters, thus allowing them to create a URL for JSF resources that they access from a GET request. As a result, the URL displayed shows the resource and all request parameters.

Developers should take note that plans are in the works to update Java EE 7 for “cloud-related practical considerations, such as multitenancy and elasticity, also known as horizontal scaling.” This will be available through JSR 342, which is scheduled to complete an early draft review on May 23, 2012. Specification leads are Oracle’s Bill Shannon and Linda DeMichiel.Access the article here.

Thursday Apr 12, 2012

A new article now up on otn/java by Deepak Vohra titled “JSF 2.0 for the Cloud, Part One,” shows how JavaServer Faces 2.0 provides features ideally suited for the virtualized computing resources of the cloud. The article focuses on @ManagedBean annotation, implicit navigation, and resource handling. Vohra illustrates how the container-based model found in Java EE 7, which allows portable applications to target single machines as well as large clusters, is well suited to the cloud architecture.

From the article--

“Cloud services might not have been a factor when JavaServer Faces 2.0 (JSF 2.0) was developed, but JSF 2.0 provides features ideally suited for the cloud, for example:• The path-based resource handling in JSF 2.0 makes handling virtualized resources much easier and provides scalability with composite components.• REST-style GET requests and bookmarkable URLs in JSF 2.0 support the cloud architecture. Representational State Transfer (REST) software architecture is based on transferring the representation of resources identified by URIs. A RESTful resource or service is made available as a URI path. Resources can be accessed in various formats, such as XML, HTML, plain text, PDF, JPEG, and JSON, among others. REST offers the advantages of being simple, lightweight, and fast.• Ajax support in JSF 2.0 is integrable with Software as a Service (SaaS) by providing interactive browser-based Web applications.” In Part Two of the series, Vohra will examine features such as Ajax support, view parameters, preemptive navigation, event handling, and bookmarkable URLs.

Friday Mar 30, 2012

In a new article up on otn/java, Java EE expert David Heffelfinger continues his series exploring the relative strengths and weaknesses of Java EE and Spring. Here, he demonstrates how easy it is to develop the data layer of an application using Java EE, JPA, and the NetBeans IDE instead of the Spring Framework.

In the first two parts of the series, he generated a complete Java EE application by using JavaServer Faces (JSF) 2.0, Enterprise JavaBeans (EJB) 3.1, and Java Persistence API (JPA) 2.0 from Spring’s Pet Clinic MySQL schema, thus showing how easy it is to develop an application whose functionality equaled that of the Spring sample application.

In his new article, Heffelfinger tweaks the application to make it more user friendly.

From the article:“The generated application displays primary keys on some of the pages, and these keys are surrogate primary keys—meaning that they have no business value and are used strictly as a unique identifier—so there is no reason why they should be visible to the user. In addition, we will modify some of the generated labels to make them more user-friendly.”

He concludes the article with a summary:“The Java EE version of the application is not a straight port of the Spring version. For example, the Java EE version enables us to create, update, and delete veterinarians as well as veterinary specialties, whereas the Spring version of the application enables us only to view veterinarians and specialties. Additionally, the Spring version has a single page for managing/viewing owners, pets, and visits, whereas the Java EE version of the application has separate pages for each of these entities.The other thing we should keep in mind is that we didn’t actually write a lot of the code and markup for the Java EE version of the application, because the bulk of it was generated by the NetBeans wizard.”

Friday Dec 16, 2011

In part two of a four-part article series on otn/java, “Spring to Java EE Migration, Part 2,” CTO and Java EE expert David Heffelfinger elaborates further on how easy it is to develop the data layer of an application using Java EE, JPA, and the NetBeans IDE instead of the Spring Framework.

Part 1 began with a Java EE rewrite of Spring's Pet Clinic sample application and developed the persistence layer of the application using Java Persistence API (JPA) 2.0, using NetBeans to generate most of the persistence layer from an existing database schema. Heffelfinger analyzed the generated code, which employed advanced JPA features.

In part 2, he continues this process by developing Enterprise JavaBeans (EJB) 3.1 session beans that act as Data Access Objects (DAOs), as well as JavaServer Faces (JSF) 2.0 managed beans and pages. Readers get to see the generated code in action and are given a look under the hood to see what’s going on.

Heffelfinger concludes Part 2 with a look ahead to Part 3:

“In the next installment of this series, we will modify the generated code to make it a bit more user friendly and we will compare the Java EE and Spring versions of the Pet Clinic application.”