[AWS] AWS Digest, Vol 55, Issue 4

Adrian Hoe 贺文耀 mailbox at adrianhoe.com
Thu Jan 21 02:03:17 CET 2010


On Dec 10, 2009, at 3:59 PM, aws-request at lists.adacore.com wrote:

> Message: 6
> Date: Wed, 9 Dec 2009 19:29:08 +0200
> From: Tero Koskinen <tero.koskinen at iki.fi>
> Subject: Re: [AWS] CSS style sheet
> To: aws at lists.adacore.com
> Message-ID: <20091209192908.3d9e2d22.tero.koskinen at iki.fi>
> Content-Type: text/plain; charset=UTF-8
>
> Hi,
>
> On Wed, 09 Dec 2009 16:06:11 +0100 Pascal Obry wrote:
>
>> Le 09/12/2009 15:58, Adrian Hoe ??? a ?crit :
>>> The page is displayed plain without any formating as defined in  
>>> css. I
>>
>> As Emmanuel as replied, you are probably missing a callback on your  
>> AWS
>> server to serve this CSS.
> [snip]
>> So you need to provide some code for this.
>>
>>   return Response.File (...);
>
> For simple purposes (=one single CSS file), I usually use following
> callback:
> http://hg.stronglytyped.org/weblog/src/tip/src/view.adb#cl-254
>
>    function CSS (Request : in AWS.Status.Data) return  
> AWS.Response.Data
>    is
>    begin
>       return AWS.Response.File (AWS.MIME.Text_CSS, Diary_CSS);
>    end CSS;
>
> Where Diary_CSS is a string pointing to the stylesheet.
>    Diary_CSS : constant String := "www/diary.css";
>
>
>> Pascal.
>
> -- 
> Tero Koskinen <tero.koskinen at iki.fi>



Thanks for your examples. A great repository with lots of examples. :P

Looks like I have only three choices (after some fiddling):

1.) Hard code the css into the html template (not recommended).

2.) Put many different css files into an external server and hard code  
the url (not quite recommended).

3.) Put everything into one single css file and use a callback to  
respond to the requests.

Is (3) the only way?

Why can't AWS support multiple css requests? (Not to question the  
design but am curious why).

What about script (javascript)?
--
"If you missed the rising sun and the morning dew, don't miss the  
beautiful sunset." -- Adrian Hoe inspired by Michal Nowak, June 15 2004
http://adrianhoe.com
http://adrianhoe.net




More information about the AWS mailing list