Posts tagged jsf
Sharing session state between JEE web applications through WebLogic session descriptor of sharing-enabled
Jan 18th
Session state in Java Web application is associated with a single (user) browser session on the one hand and typically with a specific web application on the other (server side) hand. Session state is created and maintained in the context of a usually a single web application. However…
We ran into a situation where our web application was assuming gigantic proportions. To complex to quickly deploy or even easily build, compile and test. On closer inspection, it was quickly revealed that the application really consisted of a number of relatively independent modules – say one for each of the options in the main menu and one for the entry point – main menu, login, manage user preferences etc. From a functional point of view, the big web app monster was by and large a collection of almost individual web applications. Almost because a substantial number of navigations took place between pages in these modules. And some context data – including credentials – should be passed on these navigations. The application was developed with such information stored in the session scope – as all modules always have access to a (shared) session scope, it was thought.
We got to the point where for many reasons we would like the big fat web application to be split in one web application per module. This would allow much easier development, administration, release management etc. However, we could not resolve this issue of shared session state that should be maintained across the web applications-per-module.
We contemplated moving this shared session state to a memory grid – but the impact on the existing application would be quite substantial (although an interesting challenge: introduce a new scope for managed beans (superapplication, cross-application or application-cluster) and create an EL resolver that knows where to find beans referred to with expressions like #{super-application.bean.property}; find a way for all applications in the applicationcluster to identify a user session in the same way to ensure the bean instance associated with the current session in the current application is retrieved).
An easier solution presented itself – after briefly conferring with Mike Lehmann of Oracle’s Application Server team – in the form of WebLogic Server’s session sharing capabilities.
Using custom functions in EL expressions in JSF 1.x
Jan 17th
EL expressions are one of the main driving forces for JavaServer Faces. Most dynamic characteristics of pages and widgets are governed by EL expressions. In JSF 1.x, there are some limitations for EL expressions that can at times be a little frustrating. One of the limitations is the fact that no custom functions or operators can be used in EL expressions. Quite some time ago, I wrote this article – http://technology.amis.nl/blog/622/how-to-call-methods-from-el-expressions-pre-jsp-20-trick-for-jsps-with-jstl – to demonstrate a trick for using a Map interface implementation to access custom functionality from EL expression after all.
However, things can even be better. Rather than jumping through the somewhat elaborate hoops of implementing the Map and consructing complex EL expressions, there are two other approaches. One is to create a custom EL Resolver can configure it in the faces-config.xml. Another is discussed in this article. It involves registering custom Java methods as eligible for use in EL expressions. And that really makes life a lot easier. It allows us to create EL expressions such as:
#{cel:concat (cel:upper( bean.property), cel:max(bean2.property, bean3.property), cel:avg(bean4.list))}
or
#{cel:substr(bean.property, 1, 5)}
Tour de France 2011 – Analysis using ADF DVT Graphs – Part 3 – Distance, Speed and Withdrawals with Pareto, Combination, Stock Chart (High/Low) and Bubble Chart
Jul 26th
Another article on analyzing and visualizing the results from the Tour de France 2011 using the ADF DVT components. This article uses the same set of data already discussed in several previous articles – including the standings per stage as well as the overall standings after each stage. This article will focus on using the combination graph, the bubble graph and the high/low (aka stock) chart for taking a closer look at speed, length and withdrawals (and any connection there can be between these aspects).
Some of the pretty pictures created in this article:





How to run into and resolve EL PropertyNotFound exception and propertyNotReadable in JSF with private inner class
Jun 23rd
The other day on one of the projects I am involved with, we ran into an unexpected exception, from an innocent looking EL expression:
javax.el.PropertyNotFoundException: … value=”Book #{book.title}”: Missing Resource in EL implementation: ???propertyNotReadable???
We did nothing very special, or so we thought: simple JSF page that contains an iterator component that retrieves a list of objects from a managed bean and stamps output text components for every object.
The initial page rendered fine:

based on an EL expression that uses the elements from the list but not the actual properties from those elements

however…
Getting started with PrimeFaces on GlassFish v3
Jan 7th
According to the PrimeFaces website, “PrimeFaces is an open source component suite for Java Server Faces featuring 70+ Ajax powered rich set of JSF components. Additional TouchFaces module features a UI kit for developing mobile web applications.“. Since it is an OpenSource JSF implementation that is very close to releasing JSF 2.0 compliant components, I figured it was time to try it out on GlassFish v3.
Read the rest of this entry »
Spring a surprise on a JSF developer – how Spring beans can become “JSF Managed Beans”
Dec 11th
Recently I was looking at a JavaServer Faces application, that did something relatively simple – but was exhibiting strange behavior. The output shown on the page (and this is a simplified version of the real life situation) was:
dlroWolleH
I had been asked to look into the situation and correct it. Before starting to make any changes I decided to familiarize myself with the application as it currently was. And then they almost tricked me.
The JSF page had a simple outputText component with an EL Expression in its value attribute. Something like:
<h:outputText value="#{someBean.property}"/>
I decided to take a look at the code for that bean, to understand the logic behind deriving the value of the outputText. So I first opened the faces-config.xml file to find the managed bean declaration that would tell me which class definition was behind the bean included in the EL expression. However, the faces-config.xml did not contain any managed bean definitions at all. None. And yes, I tried to see whether the web.xml specified any other faces-config.xml alternatives. But it did not.
Slowly it dawned on me Read the rest of this entry »
OOW 2009: Castle in the Clouds: SaaS-Enabling Oracle ADF Faces Applications
Oct 12th
It will be my last presentation at Oracle Open World 2009 – how to turn any ADF application into a SaaS application – an application suitable for deployment ‘on the cloud – available to users from different organizations’. One of my statements is that most if not all applications benefit from applying those same SaaS concepts. It makes applications running within the walls of an enterprise more agile, more manageable, better suited to the specific needs of individual users and user groups and easier to integrate in the IT landscape of the enterprise, both at the services level (SOA, ESB) and at the user interface level (Portlet). The presentation will discuss a number of facilities and characteristics that are desirable in SaaS applications as well as other Web Applications.
If you are interested in attending and watching the live demos, please come to the session: S307483 Castle in the Clouds: SaaS-Enabling Oracle ADF Faces Applications (Wednesday 14th October, Time: 11:45 – 12:45, Marriott Hotel, Salon 3).
Creating a custom JSF 1.2 component – with facets, resource handling, events and listeners, valueExpression and methodExpression attributes
Sep 2nd
I occasionally create custom JavaServer Faces components. Just enough to sort of remember what the steps are, but not nearly frequently enough to quickly put a new component together. This article demonstrates the quick step approach to creating a new custom component in the old fashioned way (that means: it is not a Facelets template based or an ADF Faces 11g Declarative Component). Its primary purpose is to help me quickly retrace my steps. But perhaps it will benefit some of you as well.
The Shuffler component I will develop supports facets. It will render its facet children – one after the other. Which one is rendered first can be indicated through an attribute facetOrder (values normal, reverse and random), which is EL enabled. A shuffler-method-expression can optionally be set to provide the Shuffler with a shuffle-order-processor: the method is invoked with the list of facets to shuffle and will return it in the order in which to render the children.
The component can render with a shuffle icon that when pressed causes the children to be shuffled. The Shuffler component allows registration of Shuffle Event Listeners, custom listeners that are informed whenever the shuffle event occurs.
An example of how the Shuffler can be used inside a JSF page:
Some elements of custom JSF components that are explicitly discussed in this article:
- dynamic attributes of type ValueExpression (EL enabled)
- attributes of type MethodExpression (also EL enabled)
- facets
- (custom) events and listeners
Read the rest of this entry »
Management of Boilerplate Text in JavaServer Faces Applications
Feb 20th
(including all source code left out of the article in IOUG Collaborate 2009 Select Journal)
Web applications, like any type of application, contain a great deal of boilerplate text. This includes button labels, field prompts, hint text, error messages, page titles and display label for domain values. The boilerplate text is typically specified by functional analysts and is frequently refined during testing or even later in the lifecycle of an application. Having this text embedded, hard-coded, all through the application in page definitions, backing beans, JavaScript validation functions and model classes is not a good idea. It makes efficient management of the boilerplate text virtually impossible.
Additionally, it may very well be that the boilerplate text is not static. The text may have to be aligned with whoever is accessing the application. Users from different departments or organizations may use different terminology. What for one user is a customer could be a client or patient to another user. Of course, users may speak different languages; depending on their personal preference, such as the language setting in the browser so they may desire the text to be presented in English, Spanish, or French.
This arrticle discusses an interesting challenge: A JSF application should display boilerplate text, namely titles, button labels, prompt, error messages, tool tips, etc. in a context sensitive way. This must be done not just by language, region and variant, which are the well known dimensions along which the standard JSF and Java mechanism works with Resource Bundles. Beyond this simple "locale" sensitivity, which was also needed, a more specialized context dependency was required along several dimensions.
Devoxx 2008: The major announcements
Dec 11th
At the time I’m writing this, Devoxx 2008 is well into it’s second day. Day one was quite interesting, with the major announcement being the release of JavaFX 1.0 last week. Apart from that, IBM presented their RFID technology, which has been incorporated into our access badges. Day two held another major announcement: all of Java will be made modular. That means not only the SDK, but also the JRE and even the JVM. Expected release date of JDK 7: somewhere in 2010…
Read the rest of this entry »


