I’m not terribly clear on what your question in… getContextPath will return the webapplication path w.r.t. to the application server to you so you can safely reference resources using an absolute path. Also please note that your code:
src="<%=path>/sci/sciReports.js">
is not valid, you are missing a ‘%’ character after the variable ‘path’, i.e.:
src="<%=path%>/sci/sciReports.js">
There is not really any magic going on here, if you are trying to reference a resource using “/sci/sciReports.js”, that means you are requesting from the root of your domain’s URL, in the sci directory, the resource sciReports.js, in Tomcat terms this means the url:
http://localhost:8080/sci/sciReports.js
which I imagine is invalid since you need to qualify a webapplication name (in your case ‘sciReportsWeb’).
Also note that if you just specify ‘sciReports.js’, that means relative to where you loaded the page from, sciReports.js will be in the same location; which it doesn’t sound like it is either.
As a first plan of attack, try and fix the expression tag, and then be more specific with what you are trying to do, the URL you are accessing, the code you are using, and the result you are getting and we can try and help you.