• Post Reply Bookmark Topic Watch Topic
  • New Topic

Difficulty in image file accessing  RSS feed

 
BuccaneerAnirban Bhattacharjee
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a web app. My all jsp files are located inside /WEB-INF folder. The jsps use a lot of files like , e.g- css, js , images. These are located in a folder outside /WEB-INF, and within the application context( say /sra).

Now I have a datepicker.js file (which is used by the jsp), which uses some image files. Both the image ad js file are residing in the same folder say /sra/js/datepicker.js and /sra/js/sra.gif.

But most surprisingly in the js I have to access the image file using the full path starting frm the context. In case I am giving any relative path it's not taking.

It's a major issue as my client can change the context name. In that case the images will never be laoded.

So if anyone has sol'n for this kindly post..

Regards-
Anirban
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It should not be the case, if I got the thing right.
How about doing "./" ?
 
Shashi Kant
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

you are also using the context root in the path
i.e. /sra/js/datepicker.js or /sra/js/sra.gif

instead of this just use the path like
js/datepicker.js or
js/sra.gif

Do not include the context root in the path.
Hope this will resolve your problem. :thumb:
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!