Skip to main content

Welcome to Geoff Hayward's Weblog

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

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:

<dependency>
    <groupId>org.mortbay.jetty</groupId>
    <artifactId>jsp-2.1-glassfish</artifactId>
  <version>9.1.02.B04.p0</version>
</dependency>

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

<dependency>
  <groupId>org.eclipse.jetty</groupId>
    <artifactId>jetty-jsp</artifactId>
  <version>9.3.0.M1</version>
</dependency>

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



Read

Some context: I'v just been bug fixing a JavaFX 8 application. The application has a JavaFX ComboBox that lets a user select a file name from a list. When a selection is made the file is read into a TextBox. This functionality worked fine until a clear button's event was added to the same controller.

@FXML
public void clear(ActionEvent event) {
    [...]
    myCombobox.getSelectionModel().clearSelection();
}

When a JavaFX ComboBox is cleared with .getSelectionModel().clearSelection() the onAction events of the ComboBox is called. This makes it important to null check within the onAction event.

@FXML
public void selected(ActionEvent event) {
    if (myCombobox.getValue() != null) {
        [...]
    }
}

To conclude: If the onAction event of a ComboBox uses the ComboBox's value within the event it pays to null check the ComboBox's value.



Read

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.

ResponsiveMedia