The Source for Java Technology Collaboration
User: Password:



Cay Horstmann

Cay Horstmann's Blog

Programmer Productivity, JSF, and NetBeans

Posted by cayhorstmann on June 07, 2006 at 09:08 AM | Comments (5)

Several years ago, I switched from Emacs to Eclipse. It was a bit painful at first, but Eclipse had two killer features that, once I discovered them, I could not live without.

  • Autocompletion
  • Refactor -> Rename

I have since come to love Eclipse for many other features, small and large, but those were the ones that made me switch. The instant productivity gain was worth the pain of switching.

I now do a lot more server-side programming, with JSF as the presentation technology. But I am not a happy programmer—I feel unproductive because I always get the Stack Trace From Hell.

???

(To see the image in glorious detail, right-click and select "View Image".)

At JavaOne 2006, I saw all the snazzy NetBeans demos, and I did what I did after every JavaOne: Download and install NetBeans (or Forte or Sun Studio or whatever it is called in a given year), try out the demo, wince, and uninstall. But this year, something funny happened on the way to the forum. I loaded a JSF app into NetBeans (not as painful as it used to be), configured GlassFish (ridiculously easy...) and ran the app. I noticed the Run -> Debug Main Project menu. I tried it, fully expecting it to fail. But there I was, with my app stopped at a breakpoint in a managed bean. Hmmm.

netbeans-debugger.png

This time I didn't uninstall NetBeans. A few days later, back in Eclipse and Ant, I got another STFH. An hour of headscratching, inserting logging statements, redeploying, and poring over the logs brought no enlightenment. In desperation, I fired up NetBeans and used the debugger to step through my broken component renderer code. Five minutes later I had the bug fixed.

Then I fixed the next bug in five minutes, using the nifty HTTP monitor:

???

I was actually being productive.

Can I do all that in Eclipse? Well, maybe. I asked on the GlassFish forum, and the only answer I got was a pointer to this article. Hmmm.

There is a JSF plugin that's pre-0.5 and requires WTF 1.5 and a whole army of subsidiary plugins, and an experimental GlassFish plugin that requires WTF 1.0. I tried installing that and hosed my Eclipse installation. Note to self: Try this in a separate Eclipse sandbox next time.

I stuck with NetBeans for the remainder of my project. It isn't as slick as Eclipse and it looks positively hideous--look at the four (!) kinds of tabs in the preceding screenshot.

???

My eyes hurt, but I was more productive. I discovered other nifty features. Autocompletion in JSF pages works pretty well, probably as well as it can ever work, given the dynamic nature of the EL. Running the verifier inside NetBeans is less tedious than from the command line, so I did it more often. All this upfront checking meant fewer occurrences of the STFH.

If you know a working Eclipse plugin or an inexpensive Eclipse derivative that supports JSF 1.2 with autocompletion, debugging, HTTP monitor, etc., I'd love to know. If you don't, give NetBeans 5.5 a try.


Bookmark blog post: del.icio.us del.icio.us Digg Digg DZone DZone Furl Furl Reddit Reddit
Comments
Comments are listed in date ascending order (oldest first) | Post Comment

  • Did you notice there are keyboard bindings for eclipse and emacs (as well as NetBeans) ? If you go to options you can set it under Keyboard Bindings. Also if you select Help from the NetBeans Menubar and under Help there is "Keyboard Shortcuts". Finally, if you go to NetBeans Flash Demos there are a number of Editor flash demos done by Gregg Sporrar that might be helpful.

    Posted by: cd9731 on June 07, 2006 at 11:10 AM

  • Cay: Nice to see you blogging...

    For the Eclipse plugin, we do what we can, but I suspect your experience is not worse than for other Eclipse server plugins out there. Also, what is Eclipse WTF? Is it a typo, or ho ho ho no!!!, not that!!!

    Ludo

    Posted by: ludo on June 07, 2006 at 04:00 PM

  • When NetBeans 5.5 actually releases this fall, maybe it won't hurt your eyes so much. You are actually running productively on the first beta.

    Posted by: tball on June 07, 2006 at 04:18 PM

  • Hey Cay,

    I just found that the JSF Eclipse guys have a nice tutorial on their plugin.
    Wanna try?

    Posted by: mwessendorf on June 07, 2006 at 09:21 PM

  • I've debugged web applications in Eclipse on a semi-regular basis, and haven't found it to be troublesome, but I haven't used either JSF or Glassfish to any real extent, so I can't comment on either of these, sadly.

    Posted by: diathesis on June 09, 2006 at 05:22 AM



Only logged in users may post comments. Login Here.


Powered by
Movable Type 3.01D
 Feed java.net RSS Feeds