annotate demo/cookie.ur @ 464:91914c15a85b

Cookie demo code; fix error message display
author Adam Chlipala <adamc@hcoop.net>
date Thu, 06 Nov 2008 12:22:50 -0500
parents
children ddd363e856ff
rev   line source
adamc@464 1 cookie c : {A : string, B : float, C : int}
adamc@464 2
adamc@464 3 fun set r =
adamc@464 4 setCookie c {A = r.A, B = readError r.B, C = readError r.C};
adamc@464 5 return <xml>Cookie set.</xml>
adamc@464 6
adamc@464 7 fun main () =
adamc@464 8 ro <- getCookie c;
adamc@464 9 let
adamc@464 10 val xml = case ro of
adamc@464 11 None => <xml>No cookie set.</xml>
adamc@464 12 | Some v => <xml>Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}</xml>
adamc@464 13 in
adamc@464 14 return <xml><body>
adamc@464 15 {xml}<br/><br/>
adamc@464 16
adamc@464 17 <form>
adamc@464 18 A: <textbox{#A}/><br/>
adamc@464 19 B: <textbox{#B}/><br/>
adamc@464 20 C: <textbox{#C}/><br/>
adamc@464 21 <submit action={set}/>
adamc@464 22 </form>
adamc@464 23 </body></xml>
adamc@464 24 end
adamc@464 25
adamc@464 26