The tangled web of JSF

Despite the fact that all of the web apps at my current job are .NET, I have spent a lot of time working with web apps in the Java world. I have experimented a bit with some of the web frameworks and never really found anything I really like that much. My preferred method has been to just generate XML in the app and use XSL to transform it, but there is still not an ideal separation of logic and presentation. Since JSF is (was) kind of a new thing and seems to try to copy some of the neat things about ASP.NET, I decided to do a little side project in it at work. This really would have been an ideal candidate for Ruby on Rails, but I think Ruby is a little out there in terms of having other people maintain it.

Anyway, I spent a few hours reading up on JSF in my idle time. It seemed really complicated, and nobody really explained it very well. I eventually just dived in, and ran into a bunch of problems. Eventually, I got a page to list a bunch of entries out of a database. The problem is, the DAO needs to be pretty much a pure Java Bean which means you can’t really manage connections very well. I used Hibernate to do the data access, so you need to handle creation and closing of the session object. Listing rows is simple enough to just open, list, close, but updating will get hairy. Apparently, “the way” to solve this is by using Spring Framework. I’m not really sure how it works, but apparently spring handles all the session management for you. I have been interested in Spring since first hearing about it a couple years ago, so I guess this is an opportunity to learn that as well. In any case, I am now about 3 days into the project with no real results. Way to go Java, always overcomplicating things. I hope it is worth it.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s