Mercurial > urweb
comparison 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 |
comparison
equal
deleted
inserted
replaced
463:bb27c7efcd90 | 464:91914c15a85b |
---|---|
1 cookie c : {A : string, B : float, C : int} | |
2 | |
3 fun set r = | |
4 setCookie c {A = r.A, B = readError r.B, C = readError r.C}; | |
5 return <xml>Cookie set.</xml> | |
6 | |
7 fun main () = | |
8 ro <- getCookie c; | |
9 let | |
10 val xml = case ro of | |
11 None => <xml>No cookie set.</xml> | |
12 | Some v => <xml>Cookie: A = {[v.A]}, B = {[v.B]}, C = {[v.C]}</xml> | |
13 in | |
14 return <xml><body> | |
15 {xml}<br/><br/> | |
16 | |
17 <form> | |
18 A: <textbox{#A}/><br/> | |
19 B: <textbox{#B}/><br/> | |
20 C: <textbox{#C}/><br/> | |
21 <submit action={set}/> | |
22 </form> | |
23 </body></xml> | |
24 end | |
25 | |
26 |