Skip to main content

Blog Archive for cayhorstmann during October 2009

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. Consider the usual JSF flow. The client makes a GET request for the first page. That's a special case, but from then on everything follows a pattern. The server renders a page containing an HTML form...
In the relentless fight against configuration boilerplate, JSF and Glassfish have taken yet another small step forward. As of Glassfish v3 build 68, you no longer need to declare the faces-servlet in WEB.XML. <servlet>   <servlet-name>Faces Servlet</servlet-name>   <servlet-class>javax.faces.webapp.FacesServlet</...
And now for something entirely different...one of my students asked how to write a recursive function in Scala with varargs. Apparently, the internet has lots of articles complaining about the challenge of calling Java varargs methods from Scala, but this particular issue did not google well. Here goes... In Scala, you declare varargs like this: def sum(args: Int*) = {  var result = 0 ...
I got a blogger pass for Oracle OpenWorld. Here is my report from the show floor. Yesterday, I wrote that Oracle OpenWorld seemed a bit bigger than Java One. Today when I saw the crowds during daytime I realized how naive I was. This is a HUGE conference, filling the main Moscone building, Moscone West, and two hotels. Talks range from “Virtualize your enterprise and cut costs with Oracle...
Aaron Houston, the fearless leader of the Java Champions, got me a blogger pass to Oracle OpenWorld. Here is what I learned on the opening night. If you thought Java One is big, Oracle OpenWorld seems bigger. The keynote was packed—and that on a Sunday night! The party afterwards was not in the cavernous Moscone center, but in tents on Howard Street and around Yerba Buena Gardens. The food...
When you need to produce lots of fairly straightforward graphs, Java2D is your friend. In this blog, I show you how you can render simple images as crisp-looking PDF or EPS files, provided you can draw them on a Graphics2D object. Recently, I had to draw a bunch of simple images, such as this one or this PDF Of course, you can do these drawings in Illustrator or Inkscape. But if you are a coder...
The next edition of my CS1/Java book is going to print soon. At the last minute, we decided to put the real estate of the inside covers to good use and include a “cheat sheet” with the most important Java control structures and libraries. Since it would be particularly embarrassing to have a typo here, I am hoping to enlist the aid of the community. PDFs for the inside covers are...
I just learned how to make Flash screencasts on my Linux system and deliver them (with GlassFish) on a server that the computer science department received as a donation (thanks Sun!!!). Why am I doing this? My publisher wants me to develop screencasts for my books, and I thought it could be useful for my students if I record my lectures. I use a smart board for the lectures, and a screencast...