Problem using <script src>

I am having my javascript in

D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\includes folder.

File name is scripter.js

i try to include the javascript in jsp file i have in

D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\jsp directory.

when i refer to the file with the whole path in the src attribute it is working fine

(ie) <script src="D:\Tomcat 5.0\webapps\rando\WEB-INF\bill\includes\scripter.js "></script>

but when i try to access with <script src="\bill\includes\scripter.js"> .

I dont want to use full pathname as i cannot expect all user to have it on the same path. what could be the problem. Please help me. Thank you in advance

[704 byte] By [BillJistsona] at [2007-11-27 7:53:04]
# 1
hi,use ../includes/scripter.jsthis ill workregards-venkat
noveleraa at 2007-7-12 19:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi i will try this now. If this works i will give you all the dukes. let me try
BillJistsona at 2007-7-12 19:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
hi. i tried that, but stil its not working.
BillJistsona at 2007-7-12 19:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4

my friend it won't work...

as you got to know the files placed under WEB-INF folder are generally secure unless you use a Source like a servlet or something one cannot really access it.

therefore.... please place all your .js files at

at and

D:\Tomcat 5.0\webapps\rando\bill\includes\scripter.js

use it in the below

<script src="/includes/scripter.js"></script>

or

<%

String contextPath = "http://"+request.getServerName()+":"+request.getServerPort()+request.getServerPort()+request.getContextPath();

%>

<script src="<%=contextPath%>/includes/scripter.js"></script>

to be more appropriate

RahulSharnaa at 2007-7-12 19:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
ya you are correct. thanks for your reply. you saved a lot of time for me
BillJistsona at 2007-7-12 19:34:20 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...