• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Spring Book Question

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Craig,

Is it easy to integrate JQuery with Spring App? The app that we are working on recently needs some overhaul and the user wanted to add more 'wow' factor.

Is this discussed in some manner with your book?

Thanks!
 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
jQuery is a Javascript framework and Spring is an application framework. I hope by integration you meant using jQuery for your existing Spring based application. Any applicaion that has HTML for rendering can benefit from jQuery. It does not have to be built with Spring.
 
joei salijado
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Joe,

I agree on all of the things you mentioned.
I think I did not elaborate much on my question..

For simple DOM manipulation, then I could do that with Jquery alone but I specifically wanted to know how Spring handles AJAX support and how to specifically connect the Spring Controllers to Jquery calls.

If this is discussed on some manner on this book then I would be very interested to have a copy of it.

I need to know how to integrate the backend framework with frontend GUI.


Thanks!
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This might be a useful read about AJAX simplification in Spring 3.0
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

joei salijado wrote:Hi Joe,

I agree on all of the things you mentioned.
I think I did not elaborate much on my question..

For simple DOM manipulation, then I could do that with Jquery alone but I specifically wanted to know how Spring handles AJAX support and how to specifically connect the Spring Controllers to Jquery calls.

If this is discussed on some manner on this book then I would be very interested to have a copy of it.

I need to know how to integrate the backend framework with frontend GUI.


Thanks!



I use Struts backed by Spring. I never had to bother about integrating jQuery with either of them apart from the just very fact that jQuery ajax calls should be made to a specific action class inside a namespace. The rest of all what we do is just DOM manipulation and has got nothing to do with the backend.
 
author
Posts: 422
13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

The link mentioned by Vijitha Kumara above was the first thing that came to mind when reading your question.

In short, Spring MVC controllers have traditionally been used to produce HTML output, but improvements introduced in Spring 3.0 make it even easier to write controllers that serve content in whatever format the client wants. But even then that's probably not how you should look at it...

Thinking with a RESTful mindset, controllers should serve *resources*. A resource is a *thing*...an Order, a Product, an Employee...some noun in your application. The resource that the controller serves and how it's represented are separate matters. Depending on how it's developed, the controller either returns the resource object or puts the resource into the model, but plays no direct role in deciding how it should be represented. A view resolver will decide how it's represented. Or you can use the @ResponseBody annotation along with message converters to help convert that object into XML, JSON, or whatever representation the client is asking for.

So, once the representation is settled, it is returned to the caller...whoever that may be. The caller could be another Spring application using RestTemplate to retrieve the resource. Or it could be a web browser. Or it could be some JQuery-enabled JavaScript. My point is that you don't really "hook" JQuery into Spring--but you can use JQuery to consume a resource, represented as JSON and served by a Spring MVC controller.
 
look! it's a bird! it's a plane! It's .... a teeny tiny ad
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic