Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

locating a file

 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I have a directory structure similar to:

PROJECT FOLDER (proj)

pages scripts styles

where pages contains html files, scripts contains .js files, and .css
files in styles folder.

If myStyles.css is a file in styles folder,
and XXX.html is a file in pages folder.

I'm trying to use myStyles.css inside of XXX.html.
I cannot see why using the absolute path:

does not work.

However the following two options do work, but I'm not keen on the latter.


Can anyone explain whats wrong with "/styles/myStyles.css", and
what is the best approah here.

Thanks very much
[ March 09, 2006: Message edited by: colin shuker ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64982
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the app root is proj, why would you expect it to work if you don't provide it?
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I recently passed the SCWCD exam, and when referring to an html page outside of web-inf, I just used a /, then the pages name. Not the full path name.
See what I mean?
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/styles/myStyles.css looks for a folder named styles inside the current directoy.

Eric
 
colin shuker
Ranch Hand
Posts: 750
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But for scripts you need the full path name?
Eg proj/scripts/external.js
 
Eric Pascarello
author
Rancher
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You really need to read this: http://www.webreference.com/html/tutorial2/3.html

Eric
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic