Yes, You can use a .js file inside a jsp file since you can write html in a jsp file. Just treat the jsp file like a normal html, and call the js file from html tags. For example: test.jsp ------------------- <html> <SCRIPT LANGUAGE="JavaScript" src="popup.js">\ </script> . .