Removed any (put|write)_file_content from the WSF_ or WGI_ OUTPUT classes

Now DEFAULT_SERVICE has to be created instead of inherited.
   - This seems to be better for new user, and this avoid potential conflict and difference when inheriting between the various DEFAULT_SERVICE implementation.
   - remember that DEFAULT_SERVICE, is mainly to help the user to build its very first service.
Use READABLE_STRING_8 as argument whenever it is possible.
Added WSF_RESPONSE_MESSAGE, and WSF_RESPONSE.put_response (a_response_message)
Now WSF_RESPONSE inherit from WGI_RESPONSE
This commit is contained in:
Jocelyn Fiat
2011-12-12 11:16:15 +01:00
parent 019fb539ae
commit 89572b4f33
19 changed files with 426 additions and 128 deletions

View File

@@ -8,24 +8,21 @@ class
HELLO_ROUTED_WORLD
inherit
ANY
URI_TEMPLATE_ROUTED_SERVICE
ROUTED_SERVICE_HELPER
DEFAULT_SERVICE
create
make
feature {NONE} -- Initialization
make
local
s: DEFAULT_SERVICE
do
initialize_router
make_and_launch
create s.make_and_launch (agent execute)
end
create_router
@@ -90,7 +87,11 @@ feature -- Execution
n: INTEGER
i: INTEGER
s: STRING_8
df: WSF_FILE_RESPONSE
do
create df.make_html ("index.html")
df.set_no_cache
l_url := req.script_url ("/home")
n := 3
@@ -199,7 +200,7 @@ feature -- Execution
handle_hello (ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)
do
execute_hello (req, res, Void, ctx)
execute_hello (req, res, ctx.string_parameter ("name"), ctx)
end
handle_anonymous_hello (ctx: REQUEST_URI_TEMPLATE_HANDLER_CONTEXT; req: WSF_REQUEST; res: WSF_RESPONSE)