Re: CSS background graphics
Re: CSS background graphics
- Subject: Re: CSS background graphics
- From: Chuck Hill <email@hidden>
- Date: Wed, 31 Dec 2003 12:28:23 -0800
Hi Drew,
You are facing a decision here. There are two paths. One is to turn on
Apache and use it while you are developing. The other path is the one you
are on, letting the application serve up everything. I prefer the former
path; I like to develop as I deploy.
The Apache Way
Pro:
- web server handles what it does best
- no change between development and deployment
- full power of web server available (rewrite rules, HTTPS(SSL), redirects,
virtual hosts, etc.)
Con:
- need to know how to configure a web server
- need to have web server running
The WO Way
Pro:
- no need to know how to configure a web server
- no need to have web server running
Con:
- WOResouceManager is very finicky about vending things in development mode
as you have discovered
- development is not exactly like deployment so you can run into nasty
surprises just as you deploy
- lack full power / capabilities of a web server
The choice splits along the ease vs power and dependability line. If you
go the Apache way, the document root will be as specified in the Apache
conf file. I think it is /Library/WebServer/Documents by default on OSX.
You will need to turn off Direct Connect to make this work (see methods in
WOApplication or launch with -DWODirectConnectEnabled=false). Otherwise,
it pretty much works out of the box as long as you have Apache started. :-)
Deployment documentation is here:
http://developer.apple.com/documentation/WebObjects/Deployment/Deploying_App
lications/index.html
Happy New Year!
Chuck
At 11:41 PM 30/12/2003 -0500, Drew Thoeni wrote:
>This makes great sense. This is my first app in WO and I have not yet
>made it to the deployment stage. It seemed to me that putting the
>images in the web server and letting that handle the CSS calls was the
>right thing to do. But, oddly, I can't determine the web server
>directory (and hence the URL) that WO uses in development.
>
>I'm developing on a PowerBook and my web services is actually off
>(Apache is not running). However, WO will serve up pages to the
>localhost. So, I was figuring that there must be a way to serve these
>images from WO's built-in web server and also make sure my image files
>are in the right place to make it easy for later deployment.
>
>Can you suggest a reference for how I should have set up my dev
>environment?
>
>Drew
>
>PS. I really appreciate your help, and the help others on the list are
>giving. I know it can be eye-rolling frustrating when some of these
>questions come across. But, I really feel like I've made a lot of
>progress in the past month or so.
>
>
>On Dec 30, 2003, at 10:28 PM, Chuck Hill wrote:
>
>> Drew,
>>
>> You are sort of misusing WO. From an optimization point of view you
>> should
>> avoid running static resource requests through the application. The
>> "wr?wodata" part of the URL below shows that you are using the
>> application
>> and WOResourceManager to vend the images. In addition to some quirks,
>> WOResourceManager is also a lot slower than, say, Apache at this sort
>> of
>> thing. The reason that it only works when you display the image
>> elsewhere
>> on the page is that WOResourceManager only makes it available when it
>> knows
>> that it needs to. WOResourceManager knows nothing about your external
>> CSS
>> file.
>>
>> What I would do is to put quaq_r3_c1.gif under the DocuemntRoot of your
>> webserver, let's say under /images/ and then use CSS like this:
>> background-image: url("/images/quaq_r3_c1.gif");
>>
>> You can also make the image part of the Webserver Resources of your
>> project, do a split install, and reference it like
>> background-image:
>> url("/WebObjects/WOTestApp.woa/Contents/WebServerResources/
>> quaq_r3_c1.gif");
>>
>> In general, CSS is not a WO specific technology and it is most
>> efficient to
>> keep the two separated.
>>
>> Chuck
>>
>>
>>
>> At 10:01 PM 30/12/2003 -0500, Drew Thoeni wrote:
>>> I'm using a linked style sheet in my WO application and images
>>> referenced using the CSS format below only show if the image is also
>>> being displayed elsewhere on the page using, for example, a WOImage
>>> (and this oddity took a while to figure out).
>>>
>>> Has anyone successfully displayed images in backgrounds (of tables or
>>> DIVs) from linked CSS URLs?
>>>
>>> Regards,
>>>
>>> Drew
>>>
>>>
>>> background-image:
>>> url("/cgi-bin/WebObjects/WO-quaq.woa/wr?
>>> wodata=file:/Users/drewt/Documents/WOTestApp/webServerReso
>>> ur
>>> ces/quaq_r3_c1.gif");
>>> _______________________________________________
>>> 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.
>>>
>>
>> --
>>
>> Chuck Hill email@hidden
>> Global Village Consulting Inc.
>> http://www.global-village.net
>>
>
>
--
Chuck Hill email@hidden
Global Village Consulting Inc. http://www.global-village.net
_______________________________________________
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.