contexttester.ctf
<%
display_form = true
action = Request().Form("action")
if action <> null then
action = action.toLowerCase()
if action = "set value" then
key = Request().Form("key")
if key <> null then
key = key.trim()
if key.length() > 0 then
value = Request().Form("value")
if value = null then
value = ""
else
value = value.trim()
end
Context().setAttribute(key, value)
end
end
elseif action = "remove value" then
key = Request().Form("key")
if key <> null then
key = key.trim()
if key.length() > 0 then
Context().removeAttribute(key)
end
end
elseif action = "dump context" then
Response().redirect("./dumpcontext.ctf")
display_form = false
end
end
if display_form then
%>
Context Tester
Context Tester
<%call(path() + separator() + "dump_context.cef")%>
<% end%>
==================================================
dumpcontext.ctf
#!/bin/sh /ss/bin/ss.exe
Dump Context
Dump Context
<%call(path() + separator() +"dump_context.cef")%>
Context Tester
==================================================
dump_context.cef
Response().println("Parameters:
")
e = Context().getInitParameterNames()
do while e.hasMoreElements()
key = e.nextElement().toString()
value = Context().getInitParameter(key).toString()
Response().println(key + " = [" + value + "]
")
loop
Response().println("
Attributes:
")
e = Context().getAttributeNames()
do while e.hasMoreElements()
key = e.nextElement().toString()
Response().println(key + " = [" + Context().getAttribute(key).toString() + "]
")
loop