[Erlyaws-list] yaws by-passes appmod after cashing

Rapsey rapsey@REDACTED
Fri Dec 11 07:12:52 CET 2009


Well it is a bit of a strange way to handle requests. If you have a root
appmod, why not just handle everything in the appmod? If it helps, my appmod
out script looks like this:

% all static files are in static directory
out(#arg{appmoddata = "static/" ++ _} = A) ->
    {page, [$/|A#arg.appmoddata]};
% scripts do something, but don't produce an output (always a redirect to an
appmod page)
out(#arg{appmoddata = "script/" ++ Rem} = A) ->
    my_scripts:out(Rem, A);
out(#arg{appmoddata = "profile"} = A) ->
    display_profile(A);
out(#arg{appmoddata = "register"} = A) ->
    display_register(A);
....

Registration for instance, POST is always to /script/register, which tries
to perform a registration, if successful it redirects to the next page, if
unsuccessful it redirects to /register (setting an error cookie) to display
the registration form again.


Sergej


On Fri, Dec 11, 2009 at 1:56 AM, "Jörg Maushake" <joerg.maushake@REDACTED>wrote:

> Hello, can anyone give some support?
>
>  I've to admit that iam relatively new to erlang.
>  Yesterday i did some yaws experiments:
>
>  I configured a module to be a root appmod and expected this appmod to be
> invoked for all requests.
>  This seemed to work fine at first glance but then i explored the following
> (Yaws-1.85)
>  The case
>  1) user submits a form (method post)
>  2) yaws invokes the appmod
>  3) the appmod's out function returns {page, "/something.yaws"}
>  4) yaws processes "/something.yaws" and cashes the outcome (the cashed
> outcome includes url type yaws not appmod)
>  5) browser displays the outcome to user
>  6) user steps back to the form using the browser back button and
> re-submits the form (and enters some different values prior to submitting)
>  7) yaws handles the 'POST' and looks up the cashed outcome with the
> url-type yaws and not appmod
>  8) yaws does not invoke the appmod. So the appmod can't process the input
> parameters.
>
>  Is there a bug tracking system available where i should enter this
> observation ?
>
>  Thanks in advance
>
>  Regards Jörg Maushake
> --
> Preisknaller: GMX DSL Flatrate für nur 16,99 Euro/mtl.!
> http://portal.gmx.net/de/go/dsl02
>
>
> ------------------------------------------------------------------------------
> Return on Information:
> Google Enterprise Search pays you back
> Get the facts.
> http://p.sf.net/sfu/google-dev2dev
> _______________________________________________
> Erlyaws-list mailing list
> Erlyaws-list@REDACTED
> https://lists.sourceforge.net/lists/listinfo/erlyaws-list
>


More information about the erlang-questions mailing list