Which direction to head for Java webdev frameworks?
September 30, 2005 11:52 AM   Subscribe

I'm starting to get involved with Java WebDev and would like suggestions on which direction to go.

I've been doing apache/perl/php/sql stuff under linux for four or five years now. I'm really comfortable with it, but I'd like to expand into java. I've taught myself Java about four times now, but always get stuck on the part where I actually start building stuff. I started with applets, but would really like to understand the server side. I can set up tomcat and mod_jk, and build really simple servlets, but it seems like there are a number of frameworks out there and I should pick one to focus on. Two that sort of stand out in my mind are struts and cocoon. Should I be bothering with these before having a more encyclopedic knowledge of servlets? Are there better frameworks to consider? I'd appreciate any advice. There's so much available it's hard to know where to begin, and my own digging is proving a bit frustrating (the cocoon docs are a bit cryptic, and everything looks like an xml config file...). Thanks!
posted by roue to Computers & Internet (6 answers total)
I wouldn't get involved with Struts or servlets unless you're looking at this from an employabilty standpoint. Struts is outdated and awkward to use and Servlets are too low-level to be very productive. I don't have much experience with Cocoon, but some people swear buy it (not many that I've found.)

For the front end (the part the spits out the HTML and manages the user interaction) there are tons of options. There is the new industry standard Java Server Faces, which may suffer from being designed by committee, but will probably be the next big thing. There is Tapestry, a component oriented framework that I like. There is Webwork, Struts2, etc- lots to choose from.

For the application part you have a few choices. There is J2EE type servers (this is like Weblogic, JBoss, etc) that are overkill for most small to medium projects. This includes all types of things like EJB's and DB transactions and session management, etc. I wouldn't bother with this unless you want to get in to creating huge, business apps.

Anohter choice is the Spring framework. It is the current darling of the Java devs. Its basically a framework that you use to assemble applications in a modular manner, with support for things like DB transactions.

Another thing you'll hear a lot about once you get in to this is Hibernate. This framework bascally translates relational databases to and from Java objects. Its a very nice way to abstract away SQL and worries about caching.

A good way to get an overview of all these pieces is Appfuse, an project starter that gets you up and running quickly so you can get to the fun parts.
posted by gus at 12:26 PM on September 30, 2005

JavaServer Faces has been "the next big thing" for around four years. I use Cocoon at work (it was chosen before I got here), and it's extremely flexible. You can use it with Hibernate or Spring. At my company we're being conservative and still using XSP logicsheets (incl. ESQL) with database actions, but CForms (continuations) is where all the development action is.

Like a lot of open-source programs, most contributors want to work on flashy new buzzword stuff (like AJAX support) instead of documentation or feature stability. There's definitely a steep learning curve, and you have to build your own components and fix your own bugs pretty often.

Still, if you're looking to get your feet wet in a really wide variety of technologies, Cocoon is a good place to start.
posted by hyperizer at 1:15 PM on September 30, 2005

Please don't do this. I know this isn't answering the question, but who has the time to be filling out those XML configs? Take a look at Ruby or Python or eliminate the middle man and look at Lisp, if you've got the stones for that.
posted by yerfatma at 6:44 PM on September 30, 2005

I was thinking about this today. If I was starting out in Java web devving, I would learn the spring and hibernate stack. Inversion of Control (as implemented by Spring) is a simple, effective way of wiring your objects together.

I highly recommend Matt Raible's AppFuse for getting started.
posted by toastchee at 8:20 PM on September 30, 2005

I 2nd yerfatma's advice to skip Java and go straight to Ruby.

I highly recommend the book "Agile Web Development with Rails."

I approached java a couple times (like you) from a mostly Perl background. After stalling a couple times, I finally followed through when I had a real JSP project. My conclusion: I don't like webdev work with Java. YMMV.

All the Rails hype is frankly a bit annoying, but you really need to look at this great technology.
posted by phildog at 6:35 AM on October 3, 2005

It depends on the scope of what you want to build. Ruby is probably fine for a blog or simple e-commerce site, but I've heard it doesn't scale well for more complex projects.
posted by hyperizer at 2:20 PM on October 5, 2005

« Older tv colors purdy.   |   How do you become a syndicated cartoonist? Newer »
This thread is closed to new comments.