views:

236

answers:

5

Hello, I am java developer, (using Spring-MVC)
never worked much on javascript,
But I would love to have ajax features like auto-complete, ajax-form-validation, 'server-backed-pagination for catalog (or grid)' in my applications..
And there are lot of frameworks like Dojo, prototype, YUI, jquery, etc. etc.
so My question is..
which framework is best suited for my requirements?

Criteria

  1. lightweight
  2. minimal learning curve
  3. application will return JSON
  4. need to do auto-complete, ajax-form-validation, rating

Cheers, :)

+5  A: 

The JS Framework that's the most popular nowadays (which means it's easier to get support) is probably jQuery -- and it should be OK for what you need, I'd say.

There's documentation available on the official website :

And, of course, there are lots of people that will probably be able to help you here, on StackOverflow, if you're having difficulties -- jQuery being the 8th most used tag on SO.


And you might also want to take a look at :

Pascal MARTIN
If you plan to spend some time on SO, be sure to pick JQuery. It's all the rage around here :)
Pekka
thnx. one of my friend suggested also for JQuery.. but I wanted to confirm.. :) but Now I think I should go with it.. :)
Nachiket
You're welcome :-) Have fun ^^
Pascal MARTIN
When everything's said and done, jQuery **is** a good (actually, great) starting point. The learning curve is, really, non-existant (I can't decide whether it is good or bad).
shylent
A: 

I would suggest you spend a little time checking out JQuery - http://jquery.com and JQueryUI http://jqueryui.com

Why? Not only does it satisfy 90% of your requirements, but also has a thriving community of plug-ins.

Now. Is JQuery the "only" solution? No. The Microsoft AJAX client (not server) library is decent too.

Kris Krause
I should also add that the Microsoft client-side AJAX scripts are not IE or Win32 dependent - its plain old javascript/http.
Kris Krause
+2  A: 

For some of this you may want to check out DWR. It automagically exposes Java objects as Javascript objects and looks after the client/server communication. For some of your requirements other libraries may be suitable, but DWR is useful if you have a Java backend.

Take a look at the examples here.

Brian Agnew
hmm.. DWR looks great.. really good.. but I already have used Spring MVC and exposing POJO's is already done.. And I think DWR takes care of complete communication.. thanx.. :)
Nachiket
Does Spring MVC look after exposing POJOs as Javascript then ? I didn't know that. If I'm reading that correctly, can you provide a link/more info ?
Brian Agnew
A: 

ExtJS is a little heavier than jQuery, but the UI widgets it offers are very nice. It supports AJAX, JSON, auto-completion, and form validation, and the demos will quickstart your app. I like ExtJS in part because of the very attractive UIs I can create with little or no help from a graphic artist. Finally, see this discussion to see how we marry ExtJS with Spring MVC.

Upper Stage
hi, I know ExtJs.. actually used GXT(GWT version) for enterprise app, but its really heavy, and have ready-made components, also it follows MVC i think, and MVC in javascript is complex/hard for me :)
Nachiket
Are you using Spring? MVC in Spring is really easy: controllers are the C, the M (model) is a simple Hash, and the views (V) are the JSP pages (or PDF pages or Excel spreadsheets, or HTML, or... JSON). The controller does a bunch of work - interacting with business objects and the database - gathers interesting results, places it into a hash (M), and passes the hash to a view (V). The view extracts results from the hash and renders HTML (or JSON or XML or...). As far as ExtJS being heavy, I think it's worth its weight in (...wait for it) time saved developing.
Upper Stage
A: 

You should also check Dojo which is a framework for client side scripting. The difference between JQuery and Dojo is that JQuery uses plugins but Dojo already comes with everything you need. Also benchmarking shows that Dojo is usually faster then JQuery on most browsers (I can't find it right now but you can ask around at the #dojo channel on freenone).

If you are still interested in JQuery I suggest you to read this.

the_drow