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

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="#{user.name}"
      password="#{user.password}"
      loginAction="#{user.login}"/>

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:

Running PHP Apps on GlassFish

Posted by cayhorstmann on December 9, 2009 at 8:57 PM PST

For the upcoming semester, I want to run a learning management system into which I can integrate an experimental feature for evaluating student programs. It needs to be open source so that I can modify it.

Closures? In Java 7???

Posted by cayhorstmann on November 18, 2009 at 8:22 PM PST

Today, a tantalizing announcement by Mark Reinhold about closures in Java 7 has made its way through the twittersphere.

Monitoring the HTTP Traffic in a JSF Redirect

Posted by cayhorstmann on October 20, 2009 at 10:20 AM PDT

I wanted to trace exactly what happens when a JSF page uses a redirect. Here are my experiences with the HTTP and TCP/IP monitors in NetBeans and Eclipse, and why I ended up using Wireshark instead.