• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reason not to update DOM with jQuery Ajax in a JSP page

 
Bartender
Posts: 667
14
TypeScript Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I am wondering if there is a reason not to refresh and populate it with a jquery ajax call?  The best way to approach I think would be to not use JSP all together IMO.  I don't have that choice right now and am using JSP.  I don't want the page to reload when looking through different pages of results.  Is it a bad idea or somehow bad design to be updating the dom in the JSP or should I just send the data with the JSP and have it reload all the time?  Personally, I think not reloading looks better and seems faster.  

Thank you!
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When writing Java web applications with JSP it's fine to also use Ajax. JSP can be used to generate the HTML of initial page load, and Ajax can be used to update data in the DOM as necessary, avoiding unnecessary whole-page reloads.

JSP can also be used to format HTML to return from an Ajax call.

So it isn't really a question of JSP or Ajax, but rather how each can be used to best advantage.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic