Yes, I know, the old question of the best web framework ... but let me explain.
I'm looking for Java Servlet based web framework that allowes RESTful interaktion and is also suitable to build web GUIs.
What I want:
- REST support with http content negotiation and nice URL mapping
- data conversion from request params to domain object (and ideally the other direction too)
- no need to duplicate domain object as interface to the web (like in struts)
- easy EJB integration
- dependency injection should be performed by the Java EE server
- comprehensible code (I don't like Spring MVCs magic wirering of components in the class path)
- easy to configure (what isn't configured in Spring magically is tedious to configure in the container - i'd prefer sometimes direct dependencies)
- the wheel shouldn't be reeinvented, e. g. something like JPA and BeanValidation should be used and not reinvented by the framework, or at least these standards should be easy to use.
- Validation support with display of errors in forms
- support for internationalization
The Candidates:
Spring MVC is powerful, but I'm tired of Spring configuration and don't like the programming model. I think it is a bit too abstract and flexible and hence requires to much configuration. And I don't like the way Spring MVC uses annotations. But there are also some design flaws like methods that return a value via
return
and via an output parameter - really ugly! I think it wouldn't be easy to use Spring MVC with Java EE dependency injection, since Spring MVC heavily relies on Spring DI.Roo seems to be cool, but it is just another way to create a Spring MVC app and it does some strange things with AOP.
Struts is somewhat awkward and outdatet.
Stripes The ActionBean approach doesn't look much better than Struts. I don't like it.
- Grails nice, but buggy (at least before 1.2). Reeinvents the wheel: I'd prefer JPA over Gorm for example.
See also 10 Best Java Web Frameworks
I'm not looking for frameworks with UI state on the Server like Wicket, Tapestry or JSF. I think this approach contradicts fundamental principles of the web!
So what to do? Write a framework from scratch? hmm ...
I'd like to have something like JAX-RS with support for classic browser GUIs. For example the framework should support validation and put validation error into the redisplayed form. Is there something like that? Any recommendations?