Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » File paths in static web project(Can't get relative file paths working)
File paths in static web project [message #668247] Wed, 04 May 2011 16:05 Go to next message
Al Roark is currently offline Al RoarkFriend
Messages: 2
Registered: May 2011
Junior Member
All:
I'm building my first web site and am using Eclipse + WTP to do so. One annoyance I have is that the only way I can view previews of my site (using the built-in Preview Server) while developing it is to use absolute file references to the resources on my local machine (e.g. D:\httpdocs\css\). This has become problematic because when I upload my files to the web server, all of the file references are invalid and I have to change them manually. I can't imagine this is how most people operate and am wondering how others get around this problem. Ideally, I'd like to use file paths during development that reflect the structure of my (DailyRazor's) web server. So, instead of coding links to css files using "D:\httpdocs\css" I'd like to have Eclipse recognize "/httpdocs/css". FYI: I'm using Helios on Windows 7.
Thanks Much!
Re: File paths in static web project [message #668272 is a reply to message #668247] Wed, 04 May 2011 18:37 Go to previous messageGo to next message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

What kind of relative links are not working as expected? Can you include the full workspace-relative paths to files you're linking from and to in an example with the link value?

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Re: File paths in static web project [message #668275 is a reply to message #668272] Wed, 04 May 2011 19:07 Go to previous messageGo to next message
Al Roark is currently offline Al RoarkFriend
Messages: 2
Registered: May 2011
Junior Member
Thanks for your reply, Nitin.

I have a project called 'HelloWorld' located on my machine at 'D:\HelloWorld'. This project folder contains a folder called 'httpdocs', which in turn contains a folder called 'css' as well as an 'index.html' file.

Viewing the properties for the folder 'css' from Eclipse shows the Path to be '/HelloWorld/httpdocs/css'.

The 'index.html' file contains a link to a stylesheet in the 'css' folder, which looks like:

<link rel="stylesheet" type="text/css" href="/css/style1.css" title="style1">

I've tried numerous values for href, including the entire path (/HelloWorld/httpdocs/css/style1.css), though the only thing that has worked for me is using the Windows file path.

Cheers
Re: File paths in static web project [message #669560 is a reply to message #668275] Tue, 10 May 2011 18:10 Go to previous message
Nitin Dahyabhai is currently offline Nitin DahyabhaiFriend
Messages: 4434
Registered: July 2009
Senior Member

The first question is whether this is a Static or Dynamic Web Project. Being either should set up the necessary metadata so that we know that '/' refers to /HelloWorld/httpdocs. Otherwise you'll have to use truly relative paths.

_
Nitin Dahyabhai
Eclipse Web Tools Platform
Previous Topic:Update Project Explorer with new contents of war file
Next Topic:IWAB0523E Error moving resource: ...... Could not read from source when writing file
Goto Forum:
  


Current Time: Fri Apr 19 20:14:35 GMT 2024

Powered by FUDForum. Page generated in 0.02999 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top