0

I have noticed in my web application that once the call to servlet returns and the jsp is loading, I can see the jquery js files I use for the datatables loading separately. Attached is the screen shot. Is there some configuration I need to do in web.xml or something?

Check this screen shot for the firebug snapshot

This does not happen on another jsp where I am using datatables as well. Also I have checked the code in both my jsps and the reference for the files is same as below. However when I invoke the first jsp I dont see it separately loading the files but when i invoke the second jsp, i can see it loading the files in firebug and hence it takes a few seconds longer for the page to load. What am i doing wrong?

<link rel="stylesheet" type='text/css'  href="css/styles.css">
<link rel="stylesheet" type='text/css'  href="css/jquery-ui.css">
<link rel="stylesheet" type="text/css"  href="css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="script/jquery-1.10.2.min.js"></script>
<script type="text/javascript" charset="utf8" src="script/jquery-ui.js"></script>
<script type="text/javascript" charset="utf8" src="script/jquery.dataTables.js"></script>
Aman Mohammed
  • 2,878
  • 5
  • 25
  • 39
  • You include 3 js files and get 3 files loading. That's normal. I'm not familiar with jsp but if you have a page that loads those three scripts at once, it must be combining them. – DanielST Nov 13 '14 at 21:04
  • @slicedtoad, i understand that however, I have noticed that when the js files are in the WEB-INF/script folder then these resources are locally available to the web application and these are not streamed separately. If the js files are on another location or domain and if I am loading from there, it would make sense to show another GET request in firebug. any ideas? – Aman Mohammed Nov 13 '14 at 21:19
  • One request per script file is the norm, even if they are all sourced in the same place (not sure if jsp changes that). Can you post a screenshot of a page that loads them in one get request? – DanielST Nov 13 '14 at 21:23
  • Also, those scripts each took 10ms to load. Unlikely to be a bottleneck. – DanielST Nov 13 '14 at 21:25

0 Answers0