1 2 3 Previous Next


96 posts

In my other blogging site, I've been using JDK 8 features to answer some sample interview questions.  Here's a quick recap:

To learn the Java 8 API’s, I relied on Cay Horstman‘s just released book, Java SE 8 for the Really Impatient, and I can’t recommend it enough.  It’s quite good.

The topics I covered were:

See the individual posts for more.


DSLs in Groovy Blog

Posted by driscoll Oct 20, 2012

In my other blogging site, I've covered many of the basics of creating DSLs in Groovy:

Check them out if this looks interesting - I'm about to tackle my first real example - implementing a Turtle Graphics control language.


A Turtle Graphics DSL Blog

Posted by driscoll Oct 6, 2012

JavaOne on the Cheap Blog

Posted by driscoll Sep 29, 2012

Testing JSF Blog

Posted by driscoll Jan 22, 2011

JavaOne CFP Opens Blog

Posted by driscoll Feb 11, 2010
Although I'm not involved in the talk selection process this year, I'm still paying attention to JavaOne. The Call For Papers appears to be open now, through March 14th. Be sure to read the Submission Criteria before submitting a proposal for a paper.  Trust me, it'll help your ideas get noticed. Good luck, everyone.

HTML5 Semantic Tags Blog

Posted by driscoll Feb 8, 2010

Over the weekend, I was reading Mark Pilgrim's great book on HTML5 - and when I got to the part about the semantic tags, I thought it might be worth a quick mention.

In case you've missed out on HTML5 in general (and don't want to take the time to read that book I linked above), the idea behind semantic tags is that many sites use div blocks to mark out the same kinds of content, over and over.  Content like headers, footers, and nav bars.  Changing straight <div> tags to tags like <header>, <footer>, and <nav> is granting these tags semantic meaning, hence the name - semantic tags.

Semantic tags are a great idea.  They offer a lot advantages over plain vanilla divs, especially for screen readers... but support in IE is pretty broken...  The essential problem is this:  unlike all other major browsers, IE doesn't know how to style unknown tags.  So the following code won't work:


    .border {
        border: solid black;
<section class="border">test3</section>

Ah, I hear the more informed folks in the audience say, there exists a library to fix this problem: the HTML5 Shiv.  You can use it like so:


<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>

This simple script will allow styles to be placed on unknown tags in IE... So, that's a good start, but there are a few problems with it.  For one thing, it relies on JavaScript, so if JavaScript is disabled, your styling will fail catastrophically.  Similarly, applying print styles may not work, since JavaScript won't necessarily be run as part of the print process (note:  I haven't tested this fully, but that's sure what it looks like in brief testing).  There are reports that nesting seems to mess stuff up applying styles correctly, but my testing hasn't found anything broken in this way that isn't already broken in IE's CSS support.

Of course, there is a way around even that:  If you are running JSF or some other server side processing on your backend, you could do User Agent detection, and emit <div>'s to IE and the semantic tags to all other browsers.  Then, by styling the tags solely with classes and ID's, it should be possible to make something that gets around the client side issues.  Here's a section from a component that does just that.


@FacesComponent(value = "navtag")
public class NavTag extends UIComponentBase {
    public void encodeBegin(FacesContext context) throws IOException {
        boolean isIE = false;
        UIComponent component = getCurrentComponent(context);
        String style = (String) component.getAttributes().get("style");
        String styleClass = (String) component.getAttributes().get("styleClass");
        ResponseWriter responseWriter = context.getResponseWriter();
        String ua = context.getExternalContext().getRequestHeaderMap().get("User-Agent");
        if (ua != null && ua.contains("MSIE") && !ua.contains("Opera")) {
            isIE = true;
        if (isIE) {
            responseWriter.startElement("div", null);
        } else {
            responseWriter.startElement("nav", null);
        responseWriter.writeAttribute("id", getClientId(context), "id");
        responseWriter.writeAttribute("name", getClientId(context), "clientId");
        if (styleClass != null) {
            responseWriter.writeAttribute("class", styleClass, "styleClass");
        if (style != null) {
            responseWriter.writeAttribute("style", style, "style");

Should JSF add these tags to JSF 2.1?  I'd love to hear your comments, below...

Filter Blog

By date: