5 ms·
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?
- noodle 18y agograils
- swombat 18y agoLately, 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... :-)
- waldrews 18y agoThere'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]
- icey 18y agoWell your enthusiasm made me at least google it. Here is the project page: http://seamframework.org/ http://seamframework.org/
- xefyr 18y agowaldrews: 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 18y agoneither of your emails are in your profiles. it needs to be in the "about" section to be visible.
- xefyr 18y agoThanks! +1
- noodle 18y agoout of curiosity, can you provide a good comparison of seam vs grails?
- samt 18y ago@waldrews: I have some freelance bandwidth for an interesting Seam project. Contact is in my profile.
- Mosseri 18y agoIf you are still looking for freelancers, I am available for projects. http://www.somersi.com/ http://www.somersi.com/
- timtrueman 18y agoI would use Spring and Ibatis.
- coolestuk 18y agoWebObjects
- ckuehne 18y agoWicket. If database is involved wicket+databinder.
- khill 18y agoI 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.
- xefyr 18y agoI 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.
- jrockway 18y agoSorry 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 18y agoI think the only two choices you have right now are Enclojure and Webjure. Both of which are pretty young at the moment.
- jcapote 18y agoRails + Jruby
- jamesbritt 18y agoRamaze + Sequel + JRuby
- presty 18y agohttp://code.google.com/p/google-guice/ http://code.google.com/p/google-guice/ (Disclaimer: never tried it)
- greenguy 18y agoGuice isn't a web app framework at all...
- crazybob 18y agoWarp 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/ http://code.google.com/p/warp-core/
- crazybob 18y agoOh, and GWT is my #1 choice where applicable.
- axod 18y agoI 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 18y agoWhat 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 18y agoSure, 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 ;)
- aschobel 18y agoStruts 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/ http://struts.apache.org/2.x/ Guice: Dependency injection goodness. http://code.google.com/p/google-guice/ 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/ http://code.google.com/p/google-collections/ And don't forget to use IntelliJ IDEA. Bitchin IDE. http://www.jetbrains.com/idea/ http://www.jetbrains.com/idea/ and YourKit for profiling: http://www.yourkit.com/ http://www.yourkit.com/ Using the above will make you a happy camper. Good luck!
- hochento 18y agoHave a look at AppFuse: http://www.appfuse.org/display/APF/Home http://www.appfuse.org/display/APF/Home IMHO a great Java Web App "Framework"...
- donw 18y agoAll I can say is, thanks for all the feedback! This is really useful stuff...