diff --git a/examples/simple_file/404.html b/examples/simple_file/404.html new file mode 100644 index 00000000..2c11720c --- /dev/null +++ b/examples/simple_file/404.html @@ -0,0 +1,12 @@ + + + 404 not found! + + + +

404 not found!

+ This is a static html file served by EWF. + + + + diff --git a/examples/simple_file/ewf.png b/examples/simple_file/ewf.png new file mode 100644 index 00000000..5a825a4f Binary files /dev/null and b/examples/simple_file/ewf.png differ diff --git a/examples/simple_file/home.html b/examples/simple_file/home.html index 1688589e..de5ed2c5 100644 --- a/examples/simple_file/home.html +++ b/examples/simple_file/home.html @@ -5,7 +5,9 @@

EWF simple_file example

- This is a static html file served by EWF. +

This is a static html file served by EWF.

+

Try to get lost.

+ diff --git a/examples/simple_file/service_file.ecf b/examples/simple_file/service_file.ecf index 2a023343..9674713e 100644 --- a/examples/simple_file/service_file.ecf +++ b/examples/simple_file/service_file.ecf @@ -1,14 +1,15 @@ - + - + - + diff --git a/examples/simple_file/service_file_execution.e b/examples/simple_file/service_file_execution.e index 4fc0aacf..1fc98f91 100644 --- a/examples/simple_file/service_file_execution.e +++ b/examples/simple_file/service_file_execution.e @@ -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