and how to include it in JSPs?
All Functions should be written in a common file named as <file Name>.js . This extension can be anything.
This file can be included in respective jsps using following tag ,
This tag will add all library function to that jsp.
Now you can call methods written in library.js file.