Java Spring binding tags for checkboxes and multiselect lists are broken in the Spring freemarker template.

I found this out after spending a large amount of time trying to determine why my simple validation to check for completion of required fields kept breaking on page reload after an error was found. I discovered there is an issue with the spring freemarker template macro named formMultiSelect and also in the formCheckboxes macro.

The issue is in the line determining if there is a previous selection made on the checkbox or multi-select. The check doesn’t properly dereference the variable containing the pre-selected values, and so attempts to deal with it as a string rather than an array, which causes an error similar to “freemarker.runtime – Expected collection or sequence. list evaluated instead to freemarker.template.SimpleScalar on line 368, column 12 in spring.ftl.”

The error can be corrected by copying their binding macro and modifying it to properly dereference the object in the routine to check existing values. In my case, the following line:

<#assign isSelected = contains(status.value?default([""]), value)>

became:

<#assign isSelected = contains(status.actualValue?default([""]), value)>

This change needs to be done in both the checkboxes macro as well as the formMultiSelect macro. This change allows the reload of the page to work properly after an error occurs, or if preliminary choices are made in the multi-select or checkboxes.


Recently I obtained a new cellphone and had a major issue trying to export my existing contacts to the new phone. I was left with a .dbk file which apparently is not very common and a rather strange file type. I just wanted to convert it to a .csv or a vCard file so I could import it where I needed the contact list to go. Since it took me a while to figure out how to do this, with much internet searching and false leads, I decided to write up the process I used to succesfully convert the file to a .vcf file:

  1. Rename the .dbk file to a .zip file
    1. for example, I had a test.dbk file, which I renamed to test.zip
  2. unzip the zip file
  3. within the unzipped folder, you will likely find several files, one of which will be a contacts.vcf


икониПравославни икониI spent some time at Unser Racing, an indoor Karting venue, in Denver, Colorado this weekend, and it was a great time. It was my friend Tom’s 30th birthday, so for a present I bought him a 5 race package to complement a 5 race deal for myself. I have been Karting before in Arizona at F1 Race Factory and had a great time, and Unser Racing is no different.

Unser Racing has 1 speed Honda powered racing karts that can probably hit 50 MPH, running Hoosier racing tires. They can hold more g force in a corner than most road cars and are a real kick to drive. In order to drive one, each racer has to go through safety briefing to familiarize themselves with the flagging system and the kart controls. Then you don your racing gear and helmet and hit the track.

Unser Racing’s course is pretty technical, with several lower speed hairpins and front and back sweepers that really test your physical conditioning and driving ability. The average lap time is around the 20-21 second mark, with younger drivers running in separate heats in slightly underpowered karts from the older drivers. The fastest time I was able to put in was a 20.5 second lap, and with 7 minutes of track time per session, 18-20 laps is more than enough to wear you out.

Their system is pretty cool to keep track of races paid for and run, as I bought a 5 race package but was able to do only 3 races before feeling totally wiped out. They kept the other 2 races in my name and I was able to come in and race again the next day.

I gathered from talking to some workers that there are big plans for more and longer tracks in the future, with indoor and outdoor tracks in the same complex coming in the near future. This may shape up to be the premiere spot in Colorado to go Karting. They also do corporate events and parties and things like that, so I may have to have a chat with my companies owner about where to have our next team-building event..

All together, I had a great experience, and I would recommend it to anyone looking to test their chops in a serious racing environment.

Unser Racing
7300 N. Broadway
Denver CO


Next Page »