Skip to main content

Welcome to Geoff Hayward's Weblog

Commenting on Java, JavaFX, Java EE, Joomla, and IoT.

Last night I went along to the first session of the Edison board class that is being run by the local FabLab. This class will, hopefully, take me from a novice to a maker on the Edison board in six weeks. The class will end on a huge high as the final session is going to be a day's Hackathon. How awesome is that?

In last night's session two very knowledgeable and friendly volunteers, Ian and Simon, talk the class through the features of an Edison Board. They also showed us how to set-up a PC so that it can work with the Edison board.

The session began with an introduction to the features of the Edison board. The Edison boards features include:

  • Dual-core CPU
  • WiFi
  • Bluetooth 4.0
  • 1 GB DDR
  • 4 GB FLASH memory
  • Runs Yocto Linux

Ian and Simon also give us an idea of what the board and its features can do. An idea such as, controlling outside lights using the whereabouts of a connected GPS device.

Next we learnt about expansion boards. We learnt that there are several expansion boards for the Edison, such as the ones made by Sparkfun. And that you can create your own expansion board, if you plan to attach an Edison board to your own product. During this FabLab class we are using the Arduino Edison Kit (expansion board). Here, in the following video, is an overview of the Arduino Edison Kit we are using.

Once Ian and Simon had bought us up-to-speed on the Edison board and the Arduino kit's features they showed us how to connect them up. Just like in the un-boxing and assembly video from Intel (below).

Finally, we set-up the drivers on our laptops so that next week we can start coding and attaching sensors. Our homework, for the week, is to set-up the Edison Eclipse for C/C++ IDE, set-up the Arduino IDE, and to set-up the Intel XDK IDE.

Sadly, I don't think I am going to get to use Java with the Edison board for the time being. However, I can make do with C/C++ and or JavaScript. I think the idea behind installing the three IDEs is to let us try out the different ways to code for an Edison board.

If you are interested in how the class is going keep an eye out on this blog because, I am planning to add an update post after each of sessions.

While looking for the other two video's I found the 'step-by-step guide to windows' by Carlos Montesionos to be very good. So I thought I would add it to the end of this post.

Tags: EdisonFabLab


JSF's h:outputStylesheet and h:outputScript elements have an odd way of ordering linked resources. For example if you do not set the target element of an h:outputScript to body the JavaScript is output before the CSS. This is irrespective of the order given in a template.

I needed to put an <!--[if lte IE 7]> [...] <![endif]--> element into a template. OmniFaces' o:conditionalComment is a great element for this; but the <!--[if lte IE 7]> [...] <![endif]--> condition was being output before the main CSS.

To fix this resource loading problem use a plain old HTML link elements instead of JSF h:outputStylesheet elements. Use this element with the HTML link elements having #{resource['libs:reset.css']} as there href.

<link rel="stylesheet" href="#{resource['libs:reset.css']}" />
<link rel="stylesheet" href="#{resource['css:login.css']}" />
<o:conditionalComment if="lte IE 7" >
     <link rel="stylesheet" href="#{resource['css:login-ie7.css']}" />

Will then output:

<link rel="stylesheet" href="/javax.faces.resource/reset.css?ln=libs" />
<link rel="stylesheet" href="/javax.faces.resource/login.css?ln=css" />
<!--[if lte IE 7]>
     <link rel="stylesheet" href="/javax.faces.resource/login-ie7.css?ln=css" />

Which is the desired resource ordering.

Tags: JSFOmniFaces


Sometimes JSF does not have a component that will produce a particular type of HTML element. That's not a problem but, I always forget the three method deep route to the context path. I always find I have to work through an IDE's code completion tool to find the application's path.

Here it is for next time:


A shorter version:


Just for completeness here is the JSP version:


And finaly, the scriptlet version:

    String root = pageContext.getRequest().getServletContext().getContextPath();

If you know any more please do leave a comment.



JSF Facelets can store the returned value yielded from a call to an EJB. Doing so will mean the EJB does less work.

Let's say you are implementing a Facelet that will display a message stating something like 'No results' when a collection is empty. If the collection is not empty, the Facelet will call the EJB a second time. First to calculate the size of the collection; second to display the data in the collection etc.

Here is an example:


    <ui:fragment rendered="#{pages.all().size() == 0}" >
        <h:outputText value="No pages yet." />
    <ui:fragment rendered="#{pages.all().size() > 0}" >
        <h:dataTable value="#{pages.all()}" var="page">


In the example above the Facelet calls the EJB three times. First to calculate the size of the collection; second to display the elements the data table will occupy; third the data from the collection.

How to Store Values in JSF Facelets

The calling to the EJB can be reduced to just once per page render. Calling the backing bean using the ui:param JSF element will store the returned value in a variable.

   <ui:param name="pageSet" value="#{pages.all()}" />

Using the ui:param JSF element, here is an improved example:


      <ui:param name="pageSet" value="#{pages.all()}" />


    <ui:fragment rendered="#{pageSet.size() == 0}" >
        <h:outputText value="No pages yet." />
    <ui:fragment rendered="#{pageSet.size() > 0}" >
        <h:dataTable value="#{pageSet}" var="page">


I hope this helps.


I have been trying to put an older embedded Jetty served application onto Java 8. The application's JSP files where, however, not compiling. This delayed having the benefits Java 8 brings to development.

After a lot of digging I discovered that the Mavan 'org.mortbay.jetty' namespace (a.k.a. groupid) had been superseded by 'org.eclipse.jetty'. The newer development and fixes by the Jetty project are in the later namespace. Therefore, by replacing the old 'org.mortbay.jetty' dependency:


with the new 'org.eclipse.jetty'. dependency:


the JSP's compile and the older project now works with Java 8.


Mailing List

Responsive Media

With the ResponsiveMedia plugin for Joomla it is easy to add 3rd party content from YouTube, Vimeo, and Instagram right in to any Joomla! article.