File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes HTML, CSS and JavaScript and the fly likes Extending jQuery: Best Practices for Interfacing with Server Side Technologies Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Extending jQuery: Best Practices for Interfacing with Server Side Technologies" Watch "Extending jQuery: Best Practices for Interfacing with Server Side Technologies" New topic
Author

Extending jQuery: Best Practices for Interfacing with Server Side Technologies

Eric Bresie
Greenhorn

Joined: Apr 05, 2011
Posts: 20
I have been using JSP with jQuery embedded within the pages, with assorted data for use in jQuery such as JSON or XML data via a Spring or JSP bound variable/bean.

Does Extending jQuery touch on any best practices or scenarios for dealling with interaction between jQuery and server side technologies (i.e. JSP, Spring, etc)?

Eric
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

There really isn't any interaction between jQuery and the server side except through Ajax. Remember that all that server-side markup that's in a JSP results in an HTML page that is sent to the browser, and it's that HTML page that jQuery will interact with.

Or are you asking about jQuery integration into framework code?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Keith Wood
Author
Ranch Hand

Joined: Aug 28, 2012
Posts: 38

There is one chapter on enhancing the Ajax processing of jQuery by adding custom transports and converters. Otherwise the book concentrates on the client side of operations.


Author of the upcoming "Extending jQuery" book from Manning.
Eric Bresie
Greenhorn

Joined: Apr 05, 2011
Posts: 20
Bear Bibeault wrote:There really isn't any interaction between jQuery and the server side except through Ajax. Remember that all that server-side markup that's in a JSP results in an HTML page that is sent to the browser, and it's that HTML page that jQuery will interact with.?

Or are you asking about jQuery integration into framework code?


Interaction / Integration with frameworks was the direction I was curious about. Thats the area where I feel it is easy to get confused and was looking for best practices, hopefully addressed as part of jQuery Extensions.

As an example scenarios say we have JSP page with javascript and jQuery code, which populates/filters a select widget via a Spring form:select element, populated with Spring reference Data or a dynamic data attribute binded from a hidden field to the command bean attribute associated with the page, which then you may want jquery to adjust a selected item or filter the list in some way based on other client side selections.

Do you have a variable containing XML, JSON, arraylist, Collections, object, etc which then gets handled in some way specific way on the server side which has to be handled slightly different on the client side (i.e. have to parse XML or JSON, etc) or how best to handle in the client side in general (i.e. data treated as a javascript object, an [], or something else).

Then you have other frameworks (i.e. spring, JSF, Ice Faces, etc) that may provide "Integration with other frameworks" which adds to the confusion.

I suppose in the end a good approach is to try to minimize the dependency on server side data whenever possible and make sure the interface handles the cases when it is necessary and stays consistant over time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending jQuery: Best Practices for Interfacing with Server Side Technologies
 
Similar Threads
Best tutorials to learn Spring and Hibernate
Advice on J2EE technology and book
Will JSP and other Java client technologies disappear?
Relationship between browsers and development process?
Dependable dropdowns in jsp(struts2)