//AMIS Technology Blog » el

Posts tagged el

Vacatures bij AMIS services

Using custom functions in EL expressions in JSF 1.x

1

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, More >
Vacatures bij AMIS services

How to run into and resolve EL PropertyNotFound exception and propertyNotReadable in JSF with private inner class

1

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…

(more…)

Vacatures bij AMIS services

Fun ADF challenge: showing the previous field in the tool tip for each form field

0

The other day I received the following email:

[...] thanks for your ADF articles. I will need an urgent technical help. It would be highly appreciated if you help me.

I have around 20 input text boxes in my page which shows all the current values when I open popup.

I have a hashmap which has column name and old value. Based on this I will need to show a tooptip like if I click a text box it should show a tool tip with old value.

How do I show the tool tip (shortDesc) for each text box dynamically using that hashmap?

Thank you so much.

Normally I would not respond to a query like this – I am really too busy most of the times to act as someone’s personal helpdesk. However, this was just a nice little challenge to start the day with. So, against my better judgement I responded with a few lines explaining the approach I would take. Followed by an email that had an ADF application as attachment with this functionality implemented.

In this article, I will briefly explain how I went about this. At the end, the ADF application is attached as well.

(more…)

Vacatures bij AMIS services

Spring a surprise on a JSF developer – how Spring beans can become "JSF Managed Beans"

2

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 (more…)

SIG Event

A list of the most eye catching new features in Java Server Faces release 1.2 – relevant for example to JBoss RichFaces 3.1+, Seam 2.x and ADF 11g developers

Java Server Faces 1.2 as a specification has been out for some time now. JSF 2.0 is in the works – probably looking at finalizing in the Spring of 2009. Several implementations of JSF 1.2 are available (MyFaces 1.2, JBoss RichFaces 3.1 & Seam 2.x for example), and a very important one is about to be added: ADF Faces release 11g from Oracle. (ADF 10g was based on the JSF 1.1 specifications). The JSF 1.2 release has a number of interesting new features that are worth knowing about. In this article, I briefly list some of the more important ones I have come across. (more…)

Go to Top