Claes,
1- ok, I understand
2- when I try to get an unexistent binding I get:
 
ERROR erlang  code  crashed:
File: c:/yaws/www/eVoucher//AddUser.yaws:1
Reason: {{unknown_binding,"Userr"},
         [{yaws_api,binding,1},
          {m342,out,1},
          {yaws_server,deliver_dyn_part,8},
          {yaws_server,handle_out_reply_l,6},
          {yaws_server,deliver_dyn_part,8},
          {yaws_server,aloop,3},
          {yaws_server,acceptor0,2},
          {proc_lib,init_p,5}]}
Req: {http_request,'GET',
                   {abs_path,"/eVoucher/controller.yaws?acc=addUser"},
                   {1,1}}
 
I think I tried to catch the error but it didn't work. I saw the code and think it would be very easy to return an 'undefined' value in this case...
 
Yes, that's what I did: I changed {page} and {redirect_local} with {yssi} and everything seems to work fine. Maybe I just didn't understand this should be the way to work from the beginning...
 
Thank you very much for your help,
    Sebastian-
 
 
----- Original Message -----
From: "Claes Wikstrom" <klacke@gmail.com>
To: "Sebastian Bello" <sebastian@inswitch.us>
Cc: <erlyaws-list@lists.sourceforge.net>
Sent: Wednesday, April 13, 2005 6:38 PM
Subject: Re: [Erlyaws-list] Bindings

On 4/12/05, Sebastian Bello <sebastian@inswitch.us> wrote:

> Claes,
>  
> thank you for your response.
> Just two final questions:
>     1- is there a way to pass information through a {page, URL} ? Maybe
> adding it to Arg? How?

Yes, by having the state in for example an ets table, ugly but
doable, or by passing new query args to the new page
as in:

{page, "/abc.yaws?myvar=myval;foo=bar"}

(i'm not entirely sure about the above, but I think it
will work")



>     2- is there a way to test for the existence of a binding?
>  

The bindings are put() into the process dictionary. If you call
get() and filter out all {{binding, Key}, Value} you get all bindings.

The bug whereby you saw bindings being propagated across
redirects was due to me not properly clearing the process dictionary.

Also, if you know the Key of the binding, what happens if you just request
it: just undefined or what ????

Also, another thing. You are trying to separate looks from content,
atleast that's what you wrote:
When we build webapps, we use ssi for a lot of that. It might be a good
idea to do a little writeup on that .......

 

/klacke