DOJO with spring framework

Sourabh picture Sourabh · Dec 14, 2010 · Viewed 12.8k times · Source

I am new to Spring as well as Dojo. I need to use Dojo with one of my mvc project in Spring 3.0

I came accross below link which talks about using spring-js with Dojo.spring-js part of spring framework?

http://static.springsource.org/spring-webflow/docs/2.0.x/reference/html/ch11.html

I could not really follow that link, is there any step by step tutorial which will show me how to use dojo with spring framework 3.0 ?

I need to start with simple things with Dojo like client side validation of forms.

Thanks in advance!

Answer

sioked picture sioked · Dec 15, 2010

This is a tough question to answer, because it turns out you don't really need to worry about how Dojo and Spring interact. Your client and your back end server are completely unrelated until you decide to send data back & forth.

So for dojo, you probably want to look at how to use some of the form validation. Take a look at this link for some help on that: http://o.dojotoolkit.org/book/dojo-book-0-9/part-2-dijit/form-validation-specialized-input

Once you have some validation in place, your form can use the normal form post to post your data to the server, same as how you would do it without javascript.

On the other hand, if you want to add some nice Ajax to your application, take a look at this link which explains how to implement Jackson marshalling/unmarshalling to send JSON data to Spring & handle responses correctly.

http://blog.springsource.com/2010/01/25/ajax-simplifications-in-spring-3-0/