views:

3008

answers:

19

Which is the best framework for Java? I'm looking for something similar to Symfony for php and Ruby-On-Rails for Ruby? I even don't know if anything such exists for Java or not.

A: 

Struts is for suits.

TM
You are being WAY too polite.
Alan
Django Dash's FAQ has a slightly less polite way of putting it: http://www.djangodash.com/faq/
insin
+9  A: 

There are many great web frameworks for java, but if your looking for something that is similar to Rails, look at Grails. It uses Groovy, which is dynamic language, but uses the Java VM.

Check out their quick start to determine if it's what you want.

Steve K
I think you might be interested: http://weblog.infoworld.com/openresource/archives/2008/11/springsource_jo.html?source=rss
Georgy Bolyuba
+1  A: 

I agree with the other folks who are suggesting grails- I'm using it on a couple of apps now, and it's the closest thing I've found to a java flavored ruby on rails. That said, why not use JRuby? My understanding is that they have Rails running on it now.

Tim Howland
+1  A: 

I'm not sure if you're being sarcastic or not, but if you're not here's a partial list of Java Web Frameworks:

  1. Java Server Faces (official Sun spec), various implementations are available
  2. Apache Struts
  3. Apache Shale
  4. Apache Tapestry
  5. Apache Wicket
  6. OpenSymphony WebWork
  7. Spring Framework MVC

Having only used a few of these, I can't really tell you which one is the best. Spring MVC is my personal favorite for more content oriented sites, but I'd use JSF if it's more the traditional web application (application with a web interface).

The joke amongst Java developers, generally, isn't if there's a framework/library for a certain application, but which of the dozens of options to use.

Jack Leow
Tell me about it. Somehow I feel Sun is at fault for the fragmented state. Microsoft came up with asp.net and now they sponsor (?) asp.net mvc. Most if not all MS devs will use these two frameworks. Why? Because they are easy and well-planned. Sun failed miserably with JSF, they can do much better!
Adam Asham
There's a cost to fragmenting the solution space with different frameworks, but they are each very different, so the benefit of having a variety of options outweighs the cost of having to evaluate them. If we were stuck with the One True Way (a la Microsoft), if your needs were a little different, you would be SOL. You're also dependent on that one group to expand and innovate in ways that are useful to you. Personally I use Spring a lot these days. Using annotations and autowire, you can greatly reduce the amount of code needed to make it work.
dj_segfault
A: 

Tapestry looks very cool... after you have made a BIG effort to install it.

Pablo Marambio
+4  A: 

It depends on what you want to do, but the short answer is: boy, are there! Note, however, that answer does not indicate whether the myriad of options is good or bad. Java's server side community tends to be a lot more fragmented, and while there aren't that many alternatives to Rails used in actual practice for Ruby, each of the camps on the Java side seem to be fairly well manned. As Taylor Marshall mentioned, there's Struts, which is used most often in industry (as it's the oldest still-in-use OSS MVC container I know of. But no one seems to like Struts anymore. The Ex-Jakarta menu on the Apache Jakarta page shows a number of Web Application frameworks that they've incubated, including Tapestry, Turbine, and Velocity. There's also Wicket (a very decent comparison of Wicket and Tapestry is available here). Oh, and Java Server Faces. And SpringMVC. Tapestry and Wicket (in particular) seem to be gaining ground, while everyone seems to have a horror story about JSF. Your mileage will absolutely vary here, and eesh, looking up at the links in just this answer, maybe Groovy would be simpler.

Marc Bollinger
A: 

I read about JBoss Seam and it seems nice too

Jeduan Cornejo
+4  A: 

Take a look at Spring. I think it will do anything Ruby-On-Rails can do (you can also add Hibernate for ORM).

Georgy Bolyuba
+2  A: 

As I outlined in a previous answer, I like Spring MVC.

matt b
+1  A: 

I have really enjoyed using Grails it makes extensive use of the Hibernate and Spring frameworks. The way it seperates the model view and controller is great.GORM (Grails' object relational mapping (ORM) implementation) is amazing and there are plans to separate it out into its own stand alone product.

Security is very easy using the Spring Acegi security plugin

Also worth looking at is the Searchable plugin which implements a full text search very quickly and easily.

Mark Sailes
A: 

Grails is fantastic if you need to run on a JVM. If you want to stick strictly to Java (not a dynamic language), I think spring would be your best bet.

Kevin Kaske
+1  A: 

Hands down, Grails.

Just download it from Grails.org and start working through the examples, and screencasts. The guys who make it just got bought by SpringSource, so it's guaranteed to go places!

hendrixski
A: 

I just got started with Groovy/Grails and it's looking good. What's nice is you can leverage all the existing Java technlogy.

ראובן
A: 

Spring Roo as a new framework that allows for a quick start (like Grails & Rails) but without using anything but Java (and Spring).

FarmBoy
A: 

Apache Wicket and Vaadin are my favorites. Vaadin is more for RIA / application style interfaces.

mjustin
A: 

Take a look at JRapid! Define your application model and it generates every layer for your application, including a very powerful UI.

Juan
A: 

i suggest you to check out the playframework.

Why? this article sums it up nicely.

maxmc
A: 

My current preferred Web Application Framework is the Play Framework. http://www.playframework.org.

I have used many of the other frameworks listed, such as Struts, Seam etc, but I have never used a framework that is so quick, and productive as Play. It reduces the amount of code needed to develop (rather than build boilerplate code like Roo), and it removes the code-build-deploy cycle. Compilation is done automatically by Play, and errors are displayed in the browser, making for highly successful immediate feedback.

If nothing else, I would recommend going to the Play homepage and taking a look at the screencast. It is a few minutes long, but shows the power of the framework.

Codemwnci