[AWS] embedding an image into a html response

Graham Stark graham.stark at virtual-worlds.biz
Tue Jul 25 12:19:24 CEST 2006


On Sun, 2006-07-23 at 07:05 -0700, hrvoje pejcinovic wrote:
> Hello,
> I'm trying to return a simple html page back to the
> browser with a bit of html and an gif image. Here is
> my
> response 
> 
> return AWS.Response.Build("text/html",
> "<html><body>" &
> AWS.Parameters.Get(AWS.Status.Parameters(Request),
> "name")
> & " your name has been stored. You can view it at <a
> href=""/third-page""> the third page</a>"
> & "<table><tr><td><img src=""/dw.gif"" width=""192""
> height=""18""" 
> & " alt=""testing"" /></td></td></body></html>");
> 
> 
> I have build/packaged the dw.gif with awsres utility,
> and then "with" res in my main adb file. But when
> response gets sent to the browser, no image appears.
> Does this mean that the only way to return image back
> to the user is with 
> 
> return Response.File (Content_Type => "image/png",
>                                Filename     =>        
>          
>                                "test.png");
> Clearly this would only return one image to the user,
> with no html. How are css,images,or javascript files
> to be included into response?
> 

AWS comes with a simple static resource server that you can use for
this. (I doubt is that's the proper term for it, but I'm new to this
myself). Here's my configuration for this, which serves all html,
javascript and png graphics requests. 

 Dispatchers.URI.Register_Regexp ( my_dispatcher, "/.*\.css|/.*\.js|/.*
\.png|/.*\.html",

AWS.Services.Page_Server.callback'Access );

where my_dispatcher is an AWS.Services.Dispatchers.URI.Handler. 

This is my first post to this group; I'd like to thank  Pascal and
Dmitriy for producing AWS: it's been a pleasure to use.

Graham

> Many thanks
> Hrvoje
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around 
> http://mail.yahoo.com 
> _______________________________________________
> AWS mailing list
> AWS at lists.adacore.com
> /no-more-mailman.html



More information about the AWS mailing list