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.
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.
Take a look at Spring. I think it will do anything Ruby-On-Rails can do (you can also add Hibernate for ORM).
i suggest you to check out the playframework.
Why? this article sums it up nicely.
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.
i like grails, but there are a lot of these things out there, matt raible sems to have a good handle on them:
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.
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:
- Java Server Faces (official Sun spec), various implementations are available
- Apache Struts
- Apache Shale
- Apache Tapestry
- Apache Wicket
- OpenSymphony WebWork
- 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.
Struts is for suits.
As I outlined in a previous answer, I like Spring MVC.
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.
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.
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!
I just got started with Groovy/Grails and it's looking good. What's nice is you can leverage all the existing Java technlogy.
Take a look at JRapid! Define your application model and it generates every layer for your application, including a very powerful UI.
Tapestry looks very cool... after you have made a BIG effort to install it.
I read about JBoss Seam and it seems nice too
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.
来源:https://stackoverflow.com/questions/257712/best-web-applications-framework-for-java