News for hackers. Stuff that matters.

What Java web framework would you use?

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?
( 29 comments | 14 points | on HN )
Re:What Java web framework would you use? by waldrews on Saturday August 02, 2008 @12:09PM (#265030)
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]

Re:What Java web framework would you use? by icey on Saturday August 02, 2008 @12:50PM (#265052)
Well your enthusiasm made me at least google it. Here is the project page:

http://seamframework.org/

Re:What Java web framework would you use? by Mosseri on Wednesday August 06, 2008 @12:52PM (#268661)
If you are still looking for freelancers, I am available for projects.

http://www.somersi.com/

Re:What Java web framework would you use? by samt on Saturday August 02, 2008 @06:40PM (#265253)
@waldrews: I have some freelance bandwidth for an interesting Seam project. Contact is in my profile.
Re:What Java web framework would you use? by xefyr on Saturday August 02, 2008 @01:46PM (#265094)
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.
Re:What Java web framework would you use? by staticshock on Saturday August 02, 2008 @05:33PM (#265215)
neither of your emails are in your profiles. it needs to be in the "about" section to be visible.
Re:What Java web framework would you use? by xefyr on Saturday August 02, 2008 @06:19PM (#265243)
Thanks!

+1

Re:What Java web framework would you use? by noodle on Saturday August 02, 2008 @02:57PM (#265131)
out of curiosity, can you provide a good comparison of seam vs grails?
Re:What Java web framework would you use? by khill on Saturday August 02, 2008 @12:52PM (#265054)
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.

Re:What Java web framework would you use? by jrockway on Saturday August 02, 2008 @01:44PM (#265092)
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 :)
Re:What Java web framework would you use? by icey on Monday August 04, 2008 @01:09AM (#266019)
I think the only two choices you have right now are Enclojure and Webjure. Both of which are pretty young at the moment.
Re:What Java web framework would you use? by aschobel on Saturday August 02, 2008 @09:07PM (#265310)
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!

Re:What Java web framework would you use? by crazybob on Saturday August 02, 2008 @02:38PM (#265122)
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/
Re:What Java web framework would you use? by xefyr on Saturday August 02, 2008 @01:31PM (#265080)
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.
Re:What Java web framework would you use? by axod on Saturday August 02, 2008 @03:59PM (#265165)
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.

Re:What Java web framework would you use? by davidw on Saturday August 02, 2008 @05:17PM (#265209)
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?
Re:What Java web framework would you use? by axod on Saturday August 02, 2008 @05:47PM (#265228)
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 ;)

Re:What Java web framework would you use? by crazybob on Saturday August 02, 2008 @02:39PM (#265123)
Oh, and GWT is my #1 choice where applicable.
Re:What Java web framework would you use? by swombat on Saturday August 02, 2008 @11:45AM (#265018)
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... :-)

Re:What Java web framework would you use? by hochento on Sunday August 03, 2008 @03:43AM (#265471)
Have a look at AppFuse: http://www.appfuse.org/display/APF/Home

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

Re:What Java web framework would you use? by presty on Saturday August 02, 2008 @02:24PM (#265116)
http://code.google.com/p/google-guice/

(Disclaimer: never tried it)

Re:What Java web framework would you use? by greenguy on Saturday August 02, 2008 @10:12PM (#265330)
Guice isn't a web app framework at all...
Re:What Java web framework would you use? by donw on Sunday August 03, 2008 @09:10PM (#265865)
All I can say is, thanks for all the feedback! This is really useful stuff...
Re:What Java web framework would you use? by ckuehne on Saturday August 02, 2008 @12:36PM (#265040)
Wicket. If database is involved wicket+databinder.
Re:What Java web framework would you use? by jcapote on Saturday August 02, 2008 @02:08PM (#265108)
Rails + Jruby
Re:What Java web framework would you use? by jamesbritt on Saturday August 02, 2008 @09:01PM (#265309)
Ramaze + Sequel + JRuby
Re:What Java web framework would you use? by timtrueman on Saturday August 02, 2008 @12:19PM (#265033)
I would use Spring and Ibatis.
Re:What Java web framework would you use? by coolestuk on Saturday August 02, 2008 @12:29PM (#265036)
WebObjects
Re:What Java web framework would you use? by noodle on Saturday August 02, 2008 @11:44AM (#265016)
grails