Java 8 introduces the concept of default methods to interfaces and this post looks at the cost of adding state to them.
This information pertains to the pre-release version of Java 8 mentioned in a previous post.
Miscellaneous Computer Code
Java 8 introduces the concept of default methods to interfaces and this post looks at the cost of adding state to them.
This information pertains to the pre-release version of Java 8 mentioned in a previous post.
Update: Java 8 has been released and I've implemented a library with a more elegant approach to exception handling than the one described in this post: details + downloads; source code; blog posts.
This post looks at the effect of lambdas on checked exception handling.
This code uses a pre-release Java 8 build. See the previous post for more.
Pre-release builds of Java 8 with lambda support are available for download. This post looks at lambda-8-b50-linux-x64-26_jul_2012.tar.gz.
The Contexts and Dependency Injection (CDI) API introduced in Java EE 6 complements the JSF framework. There are good reasons to favour it over JavaServer Faces (JSF) managed bean mechanisms.
CDI doesn't do everything and there are edge cases where you might want to make use of Expression Language (EL) bindings during dependency injection. Fortunately, the gaps between these APIs are easy to fill.
Some users can run afoul of Portal's user-agent rules. Symptoms include the inability to log in and form submissions just causing page refreshes where all the form data is lost.
The problem is an intersection of two things:
See Technote 1441915 for IBM's support analysis.
define(["dojo/text!./path/some.txt"], function(textData) {
Dojo's AMD loader has some useful contextual loading features.
Note the exclamation mark in the dependency.
dojo/text!
can be used to load character data;
dojo/has!
can be used to load different modules based on
environment.
Writing your own plugin is relatively trivial.
A short post about setting up a trial WebSphere Portal Express server on the (unsupported) CentOS operating system.
Like many programmers, I like to run virtual machines to isolate development and test environments from everything else I do on my laptop. My Lenovo ThinkPad didn't support all the virtualization features I wanted out of the box, but it was relatively trivial to enable them.
Errors from virtualization software manifest as complaints about missing VT-x support or a failure enabling long mode. Virtualization support needs to be enabled in the BIOS. Instructions are provided in the user guide.
This post demonstrates a way to use the Dojo 1.7 AMD loader to provide mock/stub/fake/dummy artefacts in place of the defined dependencies.
Along with a few other JavaScript libraries, Dojo is making the transition to the Asynchronous Module Definition (AMD) API. This post presents a few minimal files written to make use of it.
A previous
post discussed how to inject the FacesContext
into managed
beans using a
broker. This post demonstrates how to build on that approach with
greater levels of abstraction.
It is generally possible to remove direct JSF dependencies from managed bean code. You might want to do this to reduce coupling, improve cohesion or in the interests of writing testable code.
The code was written against Java 6, JSF 2 and JUnit 4 but the approach could be adapted to earlier versions of all of these.