Skip to main content


Showing posts from January, 2009

Disabling HTML elements (in JSPs) with JSTL's "c:if"

I've been doing some Spring-based web forms work recently and one area of interest was around disabling certain input fields until particular values were set in the form-backing object. I wanted to ensure that particular radio buttons were disabled if the value was not what I expected.

Below is a statically disabled Spring radiobutton:
<form:radiobutton path="name" disabled="true"/>For example's sake, I wanted to disabled the button if the name field of the form-backing object was "beacock", so what I needed was a boolean variable which captured the output of my particular test:<c:if test=" eq 'beacock'">
<c:set var="isMe" value="true"/>
</c:if>I could then use the above isMe variable in the following:<form:radiobutton path="name" disabled="${isMe}"/>Simple huh? But you can go a step further in the strive for clean code, the tag can take an option… - a fantastic resource for learning the guitar - and it's free!

Back in August I decided that I wanted to learn the guitar. It's been an instrument that I've always wanted to play and so I thought "why not just try to learn it?". I spoke to a friend who lent me his electric so now I just needed some lessons...

After a search on YouTube I found a few half-decent videos and then I discovered Justin Sandercoe's excellent tuition site.

It's packed full of lessons on almost everything and Justin has an excellent teaching manner - makes watching his videos entertaining and informative. I've learnt so much from watching them that it's pretty much the only place on the net that I go for guitar advice - his forums are also an excellent place to get more advice from other guitarists.

Although Justin's content is free you can donate cash if you wish to help support him as he films these wonderful instructional videos.

When people ask me if I'm having lessons I say "yes, from…