Re: Static Images
Re: Static Images
- Subject: Re: Static Images
- From: Marek Wawrzyczny <email@hidden>
- Date: Wed, 25 Jun 2003 15:56:18 +1000
On Wednesday, Jun 25, 2003, at 14:31 Australia/Sydney, Robert Walker
wrote:
Think about why you cannot use relative paths in WebObjects......
We do...
Answer: WebObjects has built-in support for load balancing your
application across multiple applications servers. The instances you
create may not reside on the web server, and for a high traffic web
sites, they really shouldn't reside on the web server. So, how can
you have a relative path when the web server is a different box than
your application server? Answer: You really can't (at least without
mapping a drive from your application servers to your web server,
which is a really BAD idea!)?
So? To connect to instance one you'd still have to type
www.mydomain.com/cgi-bin/WebObjects/1/MyApp.woa
now if this application has images with a source /img/myimage.gif, this
ismage will end up being pulled from www.mydomain.com/img/myimage.gif
which is your web server.
Anyway. we use virtual hosts and url rewrite rules. This allows us to
set up a test site where the site can be tested with new graphics or
new page layouts. If you use absolute paths, the prospect of updating
and testing a live site becomes daunting. Also, if the domain were to
ever change, you have to do a search and replace of every instance of
the path. While not impossible, this leaves room for error if you use
tools like CVS and need to restore an old version of a page.
So the answer to how you to use static images in your WebObjects
application (as several people have mentioned) is to provide an
absolute path to your images on the web server (i.e. change
images/myimage.gif to http://www.mydomain.com/images/myimage.gif).
Basically just open your static web page, perform a global search and
replace to make the paths absolute. Simple!
Or make it relative to the web server's root directory.
Marek Wawrzyczny
software engineer
-------------------------->
ish group pty ltd
7 Darghan St Glebe 2037 Australia
phone +61 2 9660 1400 fax +61 2 9660 7400
http www.ish.com.au | email email@hidden
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.