Hacker's - People who do great things with computers
Valhalla - In Norse myth, an afterlife of never ending battle.
Hacker's Valhalla - A Java Blog for info in the never ending battle of releases.
A focus on Spring, Testing and WebLogic Server.

Tuesday, November 22, 2011

So I got Apache Trinidad's partial page rendering (PPR, basically AJAX) to work, and learned about Trinidad in the process.

I was highly confused by <f:view>, <tr:document> and <trh:html> (and <trh:head> and <trh:body>). As it turns out, you don't need f:view if you're using Facelets, so no need to worry about that. The documentation about tr:document makes me think that it's a replacement for the top-level <html> tag, but it's really the top tag in a Trindad Component. So, if you need to use Trinidad's PPR you want use the <trh:html>, <trh:header> and <trh:body> tags with a <tr:form> and THEN you are good to go.

Monday, November 21, 2011

This one is usually used to either explicitly specify the JVM to use (so you won't have to worry about changes to JAVA_HOME breaking your Eclipse) or to pass arguments to the JVM being used (i.e. memory arguments usually).

The full list is pretty large. The -noSplash option looks interesting, as well as an option to give your own image file for the splash screen.

In essence, you have a trigger (like a button) and a receiver (like a tr:form that needs to be refreshed). These both need to be Trinidad components. My first attempt was to upgrade the page's current h:form to a tr:form but this caused a bizarre seeming error at runtime. Then I read the docs more thoroughly (for this blog post) and found that a tr:form seems to require that the entire page is Trinidad-ified either with a tr:document or a trh:html, trh:head and trh:body instead of the base HTML equivalents. Also note that the f:view tag is only needed for using JSF with JSP (i.e. NOT Facelets).

Thursday, November 17, 2011

I also tried upgrading from OGNL to SpEL on a Spring project recently and was surprised.

At first I thought that SpEL wasn't really a drop-in solution when I got some initial errors after switching, but SpEL (in depth intro at JavaBeat) actually caught a bug at compile time that OGNL (wiki) would only notice at runtime (and thus wasn't found before).

In general if you're talking about facelets, a component is a ui:component and a custom tag is a facelets custom tag. If you're talking about JSF, a component is a UIComponent and a custom tag is a JSP custom tag.

Tuesday, November 8, 2011

So I've been working with JSTL, JSF and Facelets for a while now and didn't come across a decent post on how to default values or work with legacy varibles (i.e. you had renamed your f:param to a component).

The solution is to use a combination of c:if and c:set tags, like the following:

Sunday, November 6, 2011

Here in the US we're ending daylight savings time ("spring ahead, fall back") and to honor this, this post will be about all of those tricky things about time that affect programming.

There are already some good posts about this issue, but here are some fun facts:

In the US west coast, the two time zones uses (yes, there are two) are Pacific Daylight Time (PDT, during the summer) and Pacific Standard Time (PST, during the winter). When it changes time zones in the fall 1:59 AM PDT is followed by 1:00 AM PST. This also causes the day to have 25 hours.

Friday, November 4, 2011

I've come across more "annoying" managers than developers, but I had a coworker who had a coworker who would dress in drag with combat boots, and put an army surplus parachute over his cube to keep it dark.

Wednesday, November 2, 2011

Right now I've been trying to figure out how to properly document Facelet includes, Spring Web Flow directories and Facelet components. It seems that for Facelet components you're to use the JSF Tag Library Descriptors (TLDs). I've been having a rough time finding how to do TLDs on the web, and could only find the (somewhat dry) entries for the Java EE 5Tutorial and Java EE 6 Tutorial.

I read all of these docs a few months ago, before "getting my hands dirty" by actually using these technologies on a project. It looks like time for a re-read.

Tuesday, November 1, 2011

So I've been working a lot with JSF, Spring Web Flow and Facelets lately. I never thought that I'd say this, but I miss something about the AribaWeb framework.

In AribaWeb there were strict components. Strict in the sense that ONLY attributes of the component (i.e. <my:component data="test"> were accessible as data. In Facelets everything in the SCOPE is visible so it is very easy to get your "reusable" components mixed up with application specific logic.

Even if you have discipline and only use component attributes you still have a namespacing problem similar to early BASH or C without the namespace keyword (i.e. your "data" variable may clobber another one accidentally).

Maybe there is a solution to this that I haven't discovered yet. Until then I may go with the old convention of prefixing names with the component name (i.e. <my:component myComponent_data="test">) and only using local attribute data. The naming convention would make that easier to check for too!