Improved the simple_file example with image, and not found message.
Use standalone connector in SCOOP concurrency mode.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
note
|
||||
description: "Summary description for {SERVICE_FILE_EXECUTION}."
|
||||
author: ""
|
||||
description: "Simple file execution, serving home.html, ewf.png and 404.html"
|
||||
date: "$Date$"
|
||||
revision: "$Revision$"
|
||||
|
||||
@@ -17,10 +16,20 @@ feature {NONE} -- Initialization
|
||||
|
||||
execute
|
||||
local
|
||||
f: WSF_FILE_RESPONSE
|
||||
mesg: WSF_RESPONSE_MESSAGE
|
||||
not_found: WSF_NOT_FOUND_RESPONSE
|
||||
do
|
||||
create f.make_html ("home.html")
|
||||
response.send (f)
|
||||
if request.path_info.is_case_insensitive_equal_general ("/") then
|
||||
create {WSF_FILE_RESPONSE} mesg.make_html ("home.html")
|
||||
elseif request.path_info.is_case_insensitive_equal_general ("/ewf.png") then
|
||||
create {WSF_FILE_RESPONSE} mesg.make_with_content_type ({HTTP_MIME_TYPES}.image_png ,"ewf.png")
|
||||
else
|
||||
create not_found.make (request)
|
||||
not_found.add_suggested_location (request.absolute_script_url (""), "Home", "Back to home page")
|
||||
|
||||
mesg := not_found
|
||||
end
|
||||
response.send (mesg)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user