• Post Reply Bookmark Topic Watch Topic
  • New Topic

Would template based framework generates a lot of request traffic?  RSS feed

 
Mike Cheung
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi if I have a web page with a lot of data to show, say a lot of tables and graphics, would using non JSP based frameworks result in a lot more individual AJAX requests? For example if the page have 5 tables, with JSP the whole page will be returned to the browser with data for all 5 tables already. But if this is a pure HTML / Javascript based view, then we need to have each of the 5 tables to make individual AJAX requests in order to render the page. Is this indeed the down side for not using JSP?

The reason I'm asking is because I'm considering moving away from JSP to a template based framework such as Thymeleaf or Freemarker.
 
Junilu Lacar
Sheriff
Posts: 10880
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't see that there's any difference with respect to using AJAX or not. You can create responsive pages that use AJAX with JSP as well. The decision to move to an alternative to JSP is usually based on ease of use and suitability to certain team dynamics and less on whether the resulting web pages are more responsive or generate more or less network traffic. In fact, AJAX results in more calls to the server but less traffic overall if your pages are designed to display only parts of the data either way.
 
Mike Cheung
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Junilu Lacar wrote:I don't see that there's any difference with respect to using AJAX or not. You can create responsive pages that use AJAX with JSP as well. The decision to move to an alternative to JSP is usually based on ease of use and suitability to certain team dynamics and less on whether the resulting web pages are more responsive or generate more or less network traffic. In fact, AJAX results in more calls to the server but less traffic overall if your pages are designed to display only parts of the data either way.

Sure yes and agreed that with JSP we can use AJAX as well but what I'm trying to state is if I need to return content say from a database (ie non static content) using JSP, the whole page can be generated and sent to browser as one response. Whereas if the page is written using HTML/JS and there are say 10 tables, I need to make 10 separate AJAX calls to populate those 10 tables. Just want to verify if this is the correct observation.
 
Junilu Lacar
Sheriff
Posts: 10880
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This has nothing to do with JSP vs other framework. It has to do with how you design the responsiveness of your page. You don't have to return the entire page either way. On the other hand, you can also return the entire page and data set using either technology. Your assumption about how JSP works in this context is incorrect.
 
Junilu Lacar
Sheriff
Posts: 10880
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
AJAX calls are not intrinsic to the alternative frameworks that you are considering, at least not that I know. It's up to you to design your page to use AJAX or not, regardless.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!