Added DEFAULT_SERVICE_LAUNCHER.make_and_launch_with_options

Added WSF_RESPONSE.redirect_now_with_content (...)
Updated hello_routed_world .. mainly example use to test/develop... not really a nice example
This commit is contained in:
Jocelyn Fiat
2011-12-14 14:44:06 +01:00
parent b60c41ee1b
commit c7366615cf
5 changed files with 113 additions and 18 deletions

View File

@@ -207,6 +207,7 @@ feature -- Redirect
h: HTTP_HEADER
do
if header_committed then
-- This might be a trouble about content-length
write_string ("Headers already sent.%NCannot redirect, for now please follow this <a %"href=%"" + a_url + "%">link</a> instead%N")
else
create h.make_with_count (1)
@@ -224,6 +225,25 @@ feature -- Redirect
redirect_now_with_custom_status_code (a_url, {HTTP_STATUS_CODE}.moved_permanently)
end
redirect_now_with_content (a_url: READABLE_STRING_8; a_content: READABLE_STRING_8; a_content_type: READABLE_STRING_8)
-- Redirect to the given url `a_url'
local
h: HTTP_HEADER
do
if header_committed then
-- This might be a trouble about content-length
write_string ("Headers already sent.%NCannot redirect, for now please follow this <a %"href=%"" + a_url + "%">link</a> instead%N")
else
create h.make_with_count (1)
h.put_location (a_url)
h.put_content_length (a_content.count)
h.put_content_type (a_content_type)
set_status_code ({HTTP_STATUS_CODE}.moved_permanently)
write_header_text (h.string)
write_string (a_content)
end
end
note
copyright: "2011-2011, Eiffel Software and others"
license: "Eiffel Forum License v2 (see http://www.eiffel.com/licensing/forum.txt)"