Suggest a good Ajax framework to be used with Spring/java? - ajax

Greetings all
i want to use ajax with spring framework
and i was wondering what framework is easy to use and has good support & samples with spring framework, like the DWR, any suggestions ?

Spring Webflows internally uses Dojo components on the clienside for Ajax calls. You can also combine your own distribution of Dojo (Spring does not include all the GUI goodies in their Dojo distribution) so that whenever you do use Dojo, you don't end up with one version of Spring and one of your own.

The Spring team prefers Dojo. I believe it's built into Spring.
There's also BlazeDS support if you want to use Flex.

We have been successfully using JQuery and ExtJs frameworks on the client side and Spring MVC / annotations on the server side.
I heard a lot about mootools also.

Related

GWT2.7 and Spring4 integration?

I am writing new application. For client side I would like to have newest gwt 2.7, but for server side code I would like to use Spring4 (firstly spring security and spring data).
Can anyone tell how it is now with integrating those 2 frameworks. I can not find any new tutorial/ information about state of integration in newest versions of those frameworks. Is there still mandatory some kind of framework: like spring4gwt or gwtrpc-spring?
I consider to use Request Factory and GWT RPC for ajax comunication, but I would like to avoid xml's as much as I can. I prefer type safe way, aka using java class. I also use tomcat7 and maven.
I am open to any sugestion. Please help.
I recently tried spring boot on the server side and GWT on the client side and it works like a charm.
You have to throw away the RPC stuff and just use REST services. To do this we use the Resty GWT library and Spring Rest Controller. This also allows us the decouple GWT from the backend and switch it with other technologies if necessary.

Confused about rich framework to be used with spring

my requirement is to develop rich web applications quickly and easily, and the framework must be easy/compatible with spring something like IceFaces
i am confused about IceFaces/PrimeFaces, or use jsp with YUI/DWR
please advise me.
I wrote Spring integration with JSF 2.1 + RichFaces 4. it works not bad, if you are searching for rapid rich client implementation it might be good choice though.
You can see basic tutorial how it works:
http://www.mkyong.com/jsf2/jsf-2-0-spring-integration-example/
SpringSource suggests PrimeFaces officially.
http://forum.springsource.org/showthread.php?98040-Which-jsf-2-component-library-to-use
ZK is a good solution and has good integration with spring
Since the question is not really PrimeFaces vs IceFaces (both JSF), but JSF vs YUI (or any other rich client framework), then the question comes down to: whatever makes sense for you. See my answer here: Spring MVC, what view components to use?.
Incase you are open to options other than "IceFaces/PrimeFaces, or use jsp with YUI/DWR"
Take a look at Spring Roo and GWT combination
It is geared for rapid development, with a lot of emphasis on template based code generation. GWT is a very powerful framework when it comes to developing Rich Applications.

Ajax support in Spring MVC 3.0

We are just starting a new web application using Spring MVC 3.0.
We will be using lot of Ajax in our application. I wanted to know if there is any in built support for Ajax (like Struts 2) in Spring MVC 3.0 or do we have to use some third party API like DWR or jQuery?
We have used lot of both DWR and jQuery in our other applications based on Struts 1 and Struts 2. So, we are very familiar with both of them.
Thanks!
Spring mvc 3 supports Ajax. Check this
As explained in the link in Viren Pushpanayagam's answer, the typical way to use ajax with Spring is to use JQuery (or plain JS or other framework, it doesn't matter) to make ajax call, passing necessary parameters. Spring controller handles request and returns JSON (which is very simple in Spring if you just annotate your controller with #ResponseBody and include Jackson Mapper or Gson in your classpath). There is no Spring tag library or other feature that performs the ajax functionality that I am aware of.

can i use Spring framework for developing JSP application?

I have Eclipse-EE 3.6 IDE...I want to develop a Web Application using JSP and Servlet.
I plan to develop this application using Spring framework.
is it possible...can i use Spring framework for developing JSP application?
can you provide some Tutorials for JSP Application development using spring for beginners.
You can use Spring MVC. Try following tutorials:
http://static.springsource.org/docs/Spring-MVC-step-by-step/
http://www.vaannila.com/spring/spring-mvc-tutorial-1.html
http://maestric.com/doc/java/spring
Thanks.
Yes, you can. JSP is a standard view technology for spring-mvc. I'd recommend the official spring-mvc documentation
Yes, I would say, that this is one of the most done use case for Spring.
Anyway: I strongly recommend to use STS (SpringSource Tool Suite), it is free and based on Eclipse 3.6 Java EE, but provides additional Spring features. For example the some templates for Spring Projects (new Project/SpringSource Tool Suite/Spring Template Project).
And one very interesting Feature: Task Base Tutorials. They are great if you want to lern form an example: Dashbord/Tutorials/

Experiences with integrating spring 3 mvc with GWT?

Given:
Spring 3.0 mvc has excellent REST support with one of the representation being JSON.
GWT simplifies development as UI is developed in java. But by default it uses RPC for client server interaction. But there is an option to use JSON.
Questions:
Can you share experiences with using Spring 3.0 mvc with GWT ?
What is the best approach to integrate these two frameworks?
Is the default GWT's MVP architecture only for client side and does it work well with JSON?
Thanks
Can you share experiences with using Spring 3.0 mvc with GWT ?
Yes. We've successfully built a whole large application around GWT and Spring MVC (1500 source files, 6 months in development).
Spring was the key to the project's success. Only with Spring we were able to test individually some pieces of the application on the server side.
What is the best approach to marry these two frameworks?
Ignore the default Servlet used by GWT and instead create your own Spring controller to handle incoming GWT-RPC requests. This blog post was the key to integrating the two techs.
We also successfully integrated other components: Flash for animated charts and third-party Javascript components for other stuff. These communicate with the server through JSON. So you have two or more kinds of URLs:
the *.rpc urls are for GWT components and are served by the Spring controller for gwt
the *.json urls are for other components and are served by another Spring controller.
Also, in our case, we shunned configuration with annotations and instead preferred configuration with the good old Spring XML files. They make it much more clear what's going on. Except for the #Required annotation; it's great to find spring beans that should be connected but aren't.
Is the default GWT's MVP architecture only for client side and does it work well with JSON?
GWT's MVP architecture works best if you follow the guide lines. Use GWT-RPC communication as Google suggests.
You can still have JSON for other client-side components.
Try this solution: GWT and Spring MVC Integration
It uses 3 classes. Its very simple, declarative and clear.
It's stupid to mix Spring MVC and GWT. Also it's stupid to mix Spring MVC and JSF... It's stupid to mix 2 MVC (MVP) frameworks together. But you can use Spring DI and GWT for sure!
You may want to check out Spring Roo. It will help you get started quickly with Spring MVC, especially when dealing with RESTful URLs. It also provides a means to automatically set up GWT "scaffolding" (GWT code to interact with the Spring MVC backend). Hope it helps!

Resources