Dynamicly generated websites in Erlang

Ulf Wiger etxuwig@REDACTED
Tue Mar 27 09:52:46 CEST 2001


On 26 Mar 2001, J Scott Jaderholm wrote:

>Hi,
>
>What options are there for dynamically generating websites in
>erlang? I'm using INETS webserver right now, but it only serves
>static pages afaik.  I'd like to be able to generate different pages
>based on
>
>1) a template file and
>
>2) information pulled out of databases (either postgresql or I might
>look into mnesia, not sure if it's appropriate in this case).


Personally, I use mnesia in a web server application that I maintain.
It works very well for my purposes. If you need to use a different
database, you may want to look at the ODBC client, or simply write
your own glue code to access the database.

If you can read a PowerPoint presentation, you may want to look at 

http://www.erlang.se/euc/00/xmerl.ppt

There is an example of how to put together fairly generic Erlang
terms and then convert them to HTML (or e.g. XML) on the way out.
(the actual example starts on slide 13.)

xmerl-0.15 has conversion functions for most HTML tags, and you
can easily put your own conversion layer on top. I've tested it
in a prototype where I inserted nice splash headers and images etc
without having to change a line of code in the program logic (just in
the conversion layer to HTML.) 

This would give you something a bit similar to templates, I think.

No good documentation though. Sorry about that.

/Uffe
-- 
Ulf Wiger                                    tfn: +46  8 719 81 95
Senior System Architect                      mob: +46 70 519 81 95
Strategic Product & System Management    ATM Multiservice Networks
Data Backbone & Optical Services Division      Ericsson Telecom AB




More information about the erlang-questions mailing list