if a jsp code contains lots of javascript methods which are not in use is that a performance issue?
There is a tiny performance hit, but in all likelihood it's much too small to be worth contemplating.
what is better in terms of performance writing code in .js file and loading the file or writing code in the .jsp file itself.
If you have it as part of the page it gets generated and sent every time the page is accessed. On the other hand, if you keep it in a separate file you save that effort on the server, because the browser will cache it as long as it's unchanged - much better.
[ February 05, 2008: Message edited by: Ulf Dittmer ]