diff --git a/examples/tutorial/step_3/hello/hello.ecf b/examples/tutorial/step_3/hello/hello.ecf
index 1cfd0b49..b58272ca 100644
--- a/examples/tutorial/step_3/hello/hello.ecf
+++ b/examples/tutorial/step_3/hello/hello.ecf
@@ -12,7 +12,7 @@
-
+
diff --git a/examples/tutorial/step_4/hello/src/hello_application.e b/examples/tutorial/step_4/hello/src/hello_application.e
index fab7157c..68dd1cec 100644
--- a/examples/tutorial/step_4/hello/src/hello_application.e
+++ b/examples/tutorial/step_4/hello/src/hello_application.e
@@ -30,11 +30,10 @@ feature {NONE} -- Initialization
do
router.map_agent ("/hello", agent execute_hello)
+ router.map_with_request_methods ("/users/{user}/message/{mesgid}", create {USER_MESSAGE_HANDLER}, router.methods_GET_POST)
+ router.map_with_request_methods ("/users/{user}/message/", create {USER_MESSAGE_HANDLER}, router.methods_GET_POST)
- router.map_with_request_methods ("/users/{user}/message/{mesgid}", create {USER_MESSAGE_HANDLER}, <<"GET", "POST">>)
- router.map_with_request_methods ("/users/{user}/message/", create {USER_MESSAGE_HANDLER}, <<"GET", "POST">>)
-
- router.map_agent_response_with_request_methods ("/users/{user}/{?op}", agent response_user, <<"GET">>)
+ router.map_agent_response_with_request_methods ("/users/{user}/{?op}", agent response_user, router.methods_GET)
end
feature -- Execution
@@ -50,6 +49,7 @@ feature -- Execution
local
mesg: WSF_HTML_PAGE_RESPONSE
s: STRING_8
+ l_user_name: READABLE_STRING_32
do
--| It is now returning a WSF_HTML_PAGE_RESPONSE
--| Since it is easier for building html page
@@ -59,9 +59,12 @@ feature -- Execution
--| this could be a query, or a form parameter
if attached {WSF_STRING} req.item ("user") as u then
--| If yes, say hello world #name
- s := "
Hello " + u.html_encoded_string + "!
"
- s.append ("Display a message")
- s.append ("Click here to quit.
")
+
+ l_user_name := (create {HTML_ENCODER}).decoded_string (u.value)
+
+ s := "Hello " + mesg.html_encoded_string (l_user_name) + "!
"
+ s.append ("Display a message")
+ s.append ("Click here to quit.
")
mesg.set_body (s)
--| We should html encode this name
--| but to keep the example simple, we don't do that for now.
@@ -69,7 +72,7 @@ feature -- Execution
--| Otherwise, ask for name
s := (create {HTML_ENCODER}).encoded_string ({STRING_32} "Hello / ahoj / नमस्ते / Ciào / مرحبا / Hola / 你好 / Hallo / Selam / Bonjour ")
s.append ("[
-