fixed compilation of rest example

This commit is contained in:
Jocelyn Fiat
2011-09-26 20:54:04 +02:00
parent df59ae579b
commit a4df57a7ac
3 changed files with 7 additions and 9 deletions

View File

@@ -65,7 +65,7 @@ feature -- Execution
(create {DEVELOPER_EXCEPTION}).raise
elseif l_op.starts_with ("env") then
s.append_string ("%N%NAll variables:")
s.append (wgi_value_iteration_to_string (req.parameters, False))
s.append (wgi_value_iteration_to_string (req.items, False))
s.append_string ("<br/>script_url(%"" + req.path_info + "%")=" + ctx.script_url (req.path_info) + "%N")
-- if attached ctx.http_authorization_login_password as t then
-- s.append_string ("Check login=" + t.login + "<br/>%N")

View File

@@ -83,15 +83,15 @@ feature -- Execution
l_redir_url: STRING
do
create h.make
-- h.put_refresh (ctx.script_url ("/doc"), 2, {HTTP_STATUS_CODE}.temp_redirect)
-- h.put_refresh (ctx.script_url ("/doc"), 2)
l_redir_url := "/doc"
h.put_refresh (l_redir_url, 2, {HTTP_STATUS_CODE}.temp_redirect)
h.put_refresh (l_redir_url, 2)
h.put_content_type_text_html
create s.make_empty
s := "Request [" + req.path_info + "] is not available. <br/>%N";
s.append ("You are being redirected to <a href=%"" + l_redir_url + "%">/doc</a> in 2 seconds ...%N")
h.put_content_length (s.count)
res.set_status_code (200)
res.set_status_code ({HTTP_STATUS_CODE}.temp_redirect)
res.write_headers_string (h.string)
res.write_string (s)
end

View File

@@ -23,18 +23,16 @@ feature {NONE} -- Initialization
feature {NONE} -- Implementation
wgi_value_iteration_to_string (cur: ITERATION_CURSOR [WGI_VALUE]; using_pre: BOOLEAN): STRING_8
wgi_value_iteration_to_string (v: ITERABLE [WGI_VALUE]; using_pre: BOOLEAN): STRING_8
do
create Result.make (100)
if using_pre then
Result.append ("<pre>")
end
from
until
cur.after
across
v as cur
loop
Result.append_string (cur.item.name.as_string_8 + " = " + cur.item.as_string.as_string_8 + "%N")
cur.forth
end
if using_pre then
Result.append ("</pre>")