

What Java web framework would you use? - donw

I may have an opportunity in the near future to do a bit of Java web programming, in exchange for many shells and beads.  Having not done much with Java in the recent past, I'm not up to speed on the current state of lightweight application frameworks, and so I am poking the collective brain of all the people here at Hacker News.  If you were going to develop a web application in Java, what framework would you use?
======
waldrews
There's no choice anymore - it's got to be Seam. It's the first Java EE
framework to really learn from Rails, eliminate the XML through annotations,
natively support Hibernate as the ORM, and still keep the perf and tooling
advantages of static typing, use the application servers for automated,
efficient state management, and generally make the vast API resources of the
JEE stack available.

On the UI side there's a lot of support for JSF components, which is good for
someone like me who wants to write the backend and have the UI just work. The
Seam code generator makes pretty instant CRUD applications that go a lot
further than any of the Rails auto-scaffolding apps.

And, if you think Java's too verbose and inelegant - there's no reason not to
write much of the application in Scala or Clojure.

And besides, it's by Gavin King. Gavin King made Hibernate. I know of no ORM
in any other language that approaches its feature set - though SQLAlchemy in
Python is moving in that direction, and acknowledges Hibernate as inspiration.
Hibernate used to be a maintenance nightmare because of the XML; the new
annotation based version keeps the power but is a lot more DRY.

The Java community really did a remarkable job of killing off the XML bloat in
the current Java EE stack - and only within the last year or so.

[if anyone out there is as enthusiastic about Seam as I am, I have budget for
several freelancer projects using it, some of which are actually not boring,
and may evolve into startups - contact me on here]

~~~
xefyr
waldrews: I have some freelancing bandwidth if you have an interesting
project. My email is in my profile while yours is not; send me a line and
we'll chat.

~~~
staticshock
neither of your emails are in your profiles. it needs to be in the "about"
section to be visible.

~~~
xefyr
Thanks!

+1

------
khill
I prefer Wicket over Seam for lightweight web applications. I spent a year or
two trying to like JSF and I just can't do it. I find that Wicket's approach
to building the UI is more closely aligned to how I work and think.

I've also played with the Stripes framework a bit and it seems like a nice
option but I haven't done anything extensive with it yet.

Hibernate is my default choice for the persistence layer. It can be a little
tricky if you're tying into an existing legacy data model with a bad design.

------
jrockway
Sorry to hijack the discussion, but are there any good Clojure frameworks? The
JVM is fine, but programming it with Java is too horrible to even discuss :)

~~~
icey
I think the only two choices you have right now are Enclojure and Webjure.
Both of which are pretty young at the moment.

------
aschobel
Struts 2: Kickass framework that gets out of your way with almost no XML. This
is more WebWork than Struts 1. <http://struts.apache.org/2.x/>

Guice: Dependency injection goodness. <http://code.google.com/p/google-guice/>

Google Collections Library: Makes java.util less painful and awkward to use.
<http://code.google.com/p/google-collections/>

And don't forget to use IntelliJ IDEA. Bitchin IDE.
<http://www.jetbrains.com/idea/>

and YourKit for profiling: <http://www.yourkit.com/>

Using the above will make you a happy camper. Good luck!

------
crazybob
Warp Widgets is the most innovative framework I've seen in a long time. It
support static type checking for the EL: <http://code.google.com/p/warp-core/>

------
xefyr
I succeeded in transitioning my workplace out of the dark ages about a year
go; I chose Spring. If nothing else, use the IOC container and AOP. While it
cannot reduce the xml-sit-ups, the Eclipse plugin does simplify their
maintenance. I've not yet toyed with EJB3, so I have no comment in that
respect. The other specific benefit of Spring is that the .NET side of the
shop has the Spring port which eases the conceptual hurdles as engineers
bounce from project to project. All that said, I'd not heard of Seam and I
will be investigating it as an alternative.

------
axod
I know this is probably an unpopular answer, but I'll answer anyway (I'm not a
framework sort of person).

None of them... Write your own. This is what I did for Mibbit, and it worked
out very well. Of course it depends on what you're writing, and if any
frameworks out there are up to the job, so maybe this advice is unhelpful for
you.

You might however be surprised just how easy it is to create your own custom
framework.

~~~
davidw
What mibbit does is significantly different from what most "CRUD" type of apps
do, though. I mean, you have templates/views like everyone else, controllers,
but then your 'model' is an IRC server, right?

~~~
axod
Sure, it is a special case in that there's the long lived http connections -
comet if you're into buzz words.

The irc client is just a plugin to the server though. Very much a general
purpose system...

As I say though I'm just not a 'framework' type of person - apart from when
its my own ;)

------
crazybob
Oh, and GWT is my #1 choice where applicable.

------
swombat
Lately, I think most people use Spring and Hibernate. I haven't used Java for
a while either, though, so I may be wrong.

Maybe you could run Rails inside a JRuby instance and deliver that... :-)

------
hochento
Have a look at AppFuse: <http://www.appfuse.org/display/APF/Home>

IMHO a great Java Web App "Framework"...

------
presty
<http://code.google.com/p/google-guice/>

(Disclaimer: never tried it)

~~~
greenguy
Guice isn't a web app framework at all...

------
donw
All I can say is, thanks for all the feedback! This is really useful stuff...

------
ckuehne
Wicket. If database is involved wicket+databinder.

------
jcapote
Rails + Jruby

~~~
jamesbritt
Ramaze + Sequel + JRuby

------
timtrueman
I would use Spring and Ibatis.

------
coolestuk
WebObjects

------
noodle
grails

