I am searching for a Java web framework which let me use jQuery to it full power like ASP.NET MVC on the .NET platform.
Any recommendations?
If you want to go crazy with jQuery in Java, then rather look for a request/action based MVC framework like Struts 1.x, Spring MVC, Stripes or Play, etc. Of them, Spring MVC is IMHO the most decent.
Component based MVC frameworks like JSF, Struts 2.x, Wicket, Echo, GWT, etc allows less fine grained control over the output. You've got to do some specific hacks/workarounds to let jQuery seamlessly communicate with the component tree in the server side. E.g, enabling a disabled HTML checkbox by $('#elementid').attr('disabled', false)
isn't enough. You've got to notify the server side somehow about the change in the view state as well, otherwise it still thinks that it is disabled and thus won't apply/process any submitted request parameter.
In some of them, especially JSF component libraries like PrimeFaces and RichFaces, jQuery (UI) is integrated as part of look'n'feel and/or to do "the Ajax works". In PrimeFaces, for example the jQuery UI accordion is implemented as a <p:accordionPanel>
. In RichFaces, there's even a special component to fire jQuery functions and keep the server side state updated, the <rich:jQuery>
.
All in all, a request/action based MVC framework is the best choice if you want full jQuery freedom. A component based MVC framework which offers libraries with jQuery integrated is a sufficient choice if you don't necessarily need to have 100% client side freedom.
Checkout Grails. It has the same feeling as ASP.NET MVC. It is not Java, but Groovy, a dynamic language built with Java. But the syntax of Groovy is similar to Java.
Or you can try Stripes if you want pure Java, eventhough it is not a fullstack framework like Grails.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With