Skip to main content

Cay Horstmann

Cay Horstmann is author of Core Java (Sun Microsystems Press 1996-2009), Enterprise Java for Elvis (Sun Microsystems Press, to appear), and co-author of Core JSF (Sun Microsystems Press 2004-2009) Cay is professor of computer science at San Jose State University. He is a computer science series editor at Prentice-Hall and a frequent speaker at computer industry conferences. For four years, Cay was VP and CTO of an Internet startup that went from 3 people in a tiny office to a public company.


cayhorstmann's blog

Another Java Web Start Pitfall

Posted by cayhorstmann on May 28, 2010 at 12:45 PM PDT

Yesterday, I installed shiny new Ubuntu Lucid Lynx on a shiny new laptop. This morning, I launched a Web Start application, and I got the following screen:

Look at the weird font. And the double checkbox.

Transforming an XML Tree with Scala Partial Functions

Posted by cayhorstmann on May 16, 2010 at 8:29 PM PDT

In my last blog, I outlined how I found the Scala XML library a pleasant solution for unpleasant XML format conversion jobs. In those jobs, I had to completely transform the document from one grammar to another.

XML Processing with Scala

Posted by cayhorstmann on May 16, 2010 at 8:31 AM PDT

A few months ago, I had one of those unpleasant format conversion jobs. I had about 1,000 multiple choice questions in RTF format and needed to import them into Moodle.

Mercurial on OpenSolaris and GlassFish

Posted by cayhorstmann on March 28, 2010 at 9:23 AM PDT

I am working on rewriting a set of labs for our intermediate students at SJSU. Version control is something that everyone with a CS degree is pretty much expected to know these days, so I thought of digging up an old Subversion lab from my open source programming class.

Composite Input Components in JSF

Posted by cayhorstmann on January 30, 2010 at 8:50 PM PST

Composite components are a great feature of JSF 2.0. The canonical example is a login component with fields for the username and password:

<mylib:login name="#{}"

Project Stage and Openness

Posted by cayhorstmann on January 13, 2010 at 7:17 AM PST

One nice thing about JSF 2.0 is that they have taken good ideas from elsewhere, such as the “project stage” concept from Rails. If you set the project stage to ”development”, you get detailed error and warning messages. If you set it to “production”, you get more aggressive caching. Better diagnostics or better performance?

A Flash in the Pan?

Posted by cayhorstmann on January 12, 2010 at 9:41 AM PST

JSF 2 introduces an EL variable flash. Anything you set persists for one post-redirect-get cycle. (In contrast, anything in the request scope is gone after a redirect.) A typical use of the flash is for messages. A managed bean method might put a message in the flash,

How to stay away from the JSF API

Posted by cayhorstmann on January 3, 2010 at 9:54 AM PST

A few weeks ago, Ed Burns posted a link to a blog on the JSF expert group mailing list, commenting “A nice one, but it doesn't mention JSF 2”.

JSF 2.0 and Tomcat

Posted by cayhorstmann on December 29, 2009 at 2:43 PM PST

As I happily wrote about new features of JSF 2.0, my coauthor David Geary kept asking me how to run the examples in Tomcat 6. I kept putting it off—hunting down all those JAR files and web.xml fragments is just too much like eating soup with a fork.

Is @javax.faces.bean.ManagedBean Dead on Arrival?

Posted by cayhorstmann on December 23, 2009 at 5:46 PM PST

Java EE 6 has three different ways of defining “beans” that are “managed” in one way or another. Here is a quick recap.

JSR 314

JSF 2.0 introduced annotations to avoid the tedium of declaring managed beans in faces-config.xml: