SlideShare a Scribd company logo
Server-side web development Using  ErlangWeb Stefan Comanescu
A brief history of Erlang Initially developed by Joe Armstrong in 1986, as a proprietary language within Ericsson for usage in telephony applications
Named after the Danish mathematician Agner Krarup Erlang
First versions were running on a Prolog interpreter, a C emulator and a compiler were later written, for reasons concerning performance
In 1997 bit syntax and binaries were added (for protocol programming) and in the same year work started on OTP
Released as open source in 1998
SMP support was added in 2006
Why Erlang ? Concurrency Actor model (no threads, no locks, no shared memory, only asynchronous message passing) Fault Tolerance Process linking, supervising trees, distribution and event managers help in keeping the system going when processes crash. Distribution Abstracts the difference between local and distributed message passing
Runs on Yaws or Inets web server
MVC (Model-View-Controller) paradigm Model – data (stored in mnesia/dets tables) manipulation
Templates – XHTML files and templating engine
Controller – Erlang functions called on dispatching rules
Dispatcher – Request routing based on regexp
Request dictionary  Reusable components (“ecomponent”)
Caching system
Annotations
Directory structure For creating the directory tree of a new application, ./bin/add is executed which generates the directories:
config –dispatch.conf, errors.conf, projects.conf, server specific .conf
docroot –static files and folders (except html templates), e.g : js, css, img
lib –framework applications and applications created by the user
log –logs created while running in embedded mode and server specific log
pipes –OS pipes for cummunicating with the shell while in embeded mode
priv –project specific data (usually static html)
release –separated subdirectories for each release version
templates –all the template files templates/cache – cached files
Generator script (bin/generate.erl) Module responsible for generating the boilerplate code
General format: ./bin/generate.erl TYPE -argument_name -argument_value
Generating a controller: ./bin/generate.erl controller --app app_name --name name_of_the_generated_model --functions (fun1, fun2)
./bin/generate.erl model --app app_name --name name_of_the_generated_model --hrl name_of_the_header_file  Generates a file named wtype_name where 'name' is the given arg
Generates basic CRUD functionality for the given header
Dispatcher Dispatching types Static dispatching: serving static content, like xml pages, media or javascript. The controller is not accessed. The server first searches for the file in the “templates” dir, afterward in the “docroot” dir. For faster retrieval of static content, they should be placed in the docroot dir and enoent should be placed instead of File  {static, Regexp, File} | {static, Regexp, enoent} Dynamic dispatching: the controller will handle the URL requests allowing specific content to be created or retrieved on demand {dynamic, Regexp, {Module, Function}}  Alias dispatching: if the URL matches the Regexp, the rule of NewURL will be triggered {alias, Regexp, NewURL} Delegates: passing the URL to another dispatch config file, only helps in structuring the application {dynamic, delegate, Regexp, File}
Dispatcher evaluation order Docroot content is served (files that point to 'enoent')
Dynamic entries are matched with their URLs

More Related Content

What's hot (20)

PDF
Apache solr liferay
Binesh Gummadi
 
PPT
Xml parsers
Manav Prasad
 
PPT
Chapter 12 - File Input and Output
Eduardo Bergavera
 
PPTX
Ot performance webinar
Suite Solutions
 
PDF
Java JDBC
Jussi Pohjolainen
 
PPTX
Spl to the Rescue - Zendcon 09
Elizabeth Smith
 
PPTX
Tutorial on developing a Solr search component plugin
searchbox-com
 
PDF
Writing and using php streams and sockets tek11
Elizabeth Smith
 
PPTX
Java 8 Feature Preview
Jim Bethancourt
 
PDF
Java 8 by example!
Mark Harrison
 
PDF
SPL to the Rescue - Tek 09
Elizabeth Smith
 
PDF
32.java input-output
santosh mishra
 
PPTX
Io streams
Elizabeth alexander
 
PDF
Solr Troubleshooting - TreeMap approach
Alexandre Rafalovitch
 
PDF
Code generating beans in Java
Stephen Colebourne
 
PDF
Spl in the wild
Elizabeth Smith
 
DOC
Servlet basics
Santosh Dhoundiyal
 
PDF
Query Parsing - Tips and Tricks
Erik Hatcher
 
PDF
From content to search: speed-dating Apache Solr (ApacheCON 2018)
Alexandre Rafalovitch
 
PPTX
Streams, sockets and filters oh my!
Elizabeth Smith
 
Apache solr liferay
Binesh Gummadi
 
Xml parsers
Manav Prasad
 
Chapter 12 - File Input and Output
Eduardo Bergavera
 
Ot performance webinar
Suite Solutions
 
Spl to the Rescue - Zendcon 09
Elizabeth Smith
 
Tutorial on developing a Solr search component plugin
searchbox-com
 
Writing and using php streams and sockets tek11
Elizabeth Smith
 
Java 8 Feature Preview
Jim Bethancourt
 
Java 8 by example!
Mark Harrison
 
SPL to the Rescue - Tek 09
Elizabeth Smith
 
32.java input-output
santosh mishra
 
Solr Troubleshooting - TreeMap approach
Alexandre Rafalovitch
 
Code generating beans in Java
Stephen Colebourne
 
Spl in the wild
Elizabeth Smith
 
Servlet basics
Santosh Dhoundiyal
 
Query Parsing - Tips and Tricks
Erik Hatcher
 
From content to search: speed-dating Apache Solr (ApacheCON 2018)
Alexandre Rafalovitch
 
Streams, sockets and filters oh my!
Elizabeth Smith
 

Viewers also liked (16)

PDF
Erlang web framework: Chicago boss
Barcamp Saigon
 
PDF
Caching Strategies for an Erlang Based Web Stack
enriquepazperez
 
PDF
learn you some erlang - chap 6 to chap7
경미 김
 
PDF
learn you some erlang - chap0 to chap2
경미 김
 
PDF
WebCamp: Developer Day: N2O: The Most Powerful Erlang Web Framework - Максим ...
GeeksLab Odessa
 
PDF
MPI, Erlang and the web
Lenz Gschwendtner
 
PPTX
Why erlang
Doug Goldie
 
PPT
Erlang을 이용한 swap 서버
Jaejin Yun
 
PPS
Erlang plus BDB: Disrupting the Conventional Web Wisdom
guest3933de
 
PDF
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
 
PDF
Erlang Practice
litaocheng
 
PDF
learn you some erlang - chap13 to chap14
경미 김
 
PPTX
Actors in erlang
Hyun Dong Lee
 
PDF
Barcamp2013
Thai Cuong
 
PDF
Using OTP and gen_server Effectively
Ken Pratt
 
PDF
NoSQL CGN: Riak (01/2012)
Sebastian Cohnen
 
Erlang web framework: Chicago boss
Barcamp Saigon
 
Caching Strategies for an Erlang Based Web Stack
enriquepazperez
 
learn you some erlang - chap 6 to chap7
경미 김
 
learn you some erlang - chap0 to chap2
경미 김
 
WebCamp: Developer Day: N2O: The Most Powerful Erlang Web Framework - Максим ...
GeeksLab Odessa
 
MPI, Erlang and the web
Lenz Gschwendtner
 
Why erlang
Doug Goldie
 
Erlang을 이용한 swap 서버
Jaejin Yun
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
guest3933de
 
Design Patterns for Distributed Non-Relational Databases
guestdfd1ec
 
Erlang Practice
litaocheng
 
learn you some erlang - chap13 to chap14
경미 김
 
Actors in erlang
Hyun Dong Lee
 
Barcamp2013
Thai Cuong
 
Using OTP and gen_server Effectively
Ken Pratt
 
NoSQL CGN: Riak (01/2012)
Sebastian Cohnen
 
Ad

Similar to Developing web apps using Erlang-Web (20)

ODP
Why Python Web Frameworks Are Changing the Web
joelburton
 
PDF
Mojolicious
Marcos Rebelo
 
PDF
The Django Web Application Framework
Simon Willison
 
PDF
The Ring programming language version 1.5.3 book - Part 53 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.5.3 book - Part 43 of 184
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.7 book - Part 47 of 196
Mahmoud Samir Fayed
 
PDF
Lightweight web frameworks
Jonathan Holloway
 
PDF
The Ring programming language version 1.10 book - Part 53 of 212
Mahmoud Samir Fayed
 
PPTX
How to Make AJAX Applications Scream on the Client
goodfriday
 
ODP
Web Server-Side Programming Techniques
guest8899ec02
 
PDF
TurboGears2 Pluggable Applications
Alessandro Molina
 
PDF
The Ring programming language version 1.4 book - Part 12 of 30
Mahmoud Samir Fayed
 
PDF
The Ring programming language version 1.3 book - Part 33 of 88
Mahmoud Samir Fayed
 
PDF
Mojolicious, real-time web framework
taggg
 
PDF
Compiled Websites with Plone, Django, Xapian and SSI
Wojciech Lichota
 
ODP
Exploiting the newer perl to improve your plugins
Marian Marinov
 
ODP
EXPath: the packaging system and the webapp framework
Florent Georges
 
RTF
W3af
vjbala
 
PDF
Os Pruett
oscon2007
 
PPTX
The Django Web Application Framework 2
fishwarter
 
Why Python Web Frameworks Are Changing the Web
joelburton
 
Mojolicious
Marcos Rebelo
 
The Django Web Application Framework
Simon Willison
 
The Ring programming language version 1.5.3 book - Part 53 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 43 of 184
Mahmoud Samir Fayed
 
The Ring programming language version 1.7 book - Part 47 of 196
Mahmoud Samir Fayed
 
Lightweight web frameworks
Jonathan Holloway
 
The Ring programming language version 1.10 book - Part 53 of 212
Mahmoud Samir Fayed
 
How to Make AJAX Applications Scream on the Client
goodfriday
 
Web Server-Side Programming Techniques
guest8899ec02
 
TurboGears2 Pluggable Applications
Alessandro Molina
 
The Ring programming language version 1.4 book - Part 12 of 30
Mahmoud Samir Fayed
 
The Ring programming language version 1.3 book - Part 33 of 88
Mahmoud Samir Fayed
 
Mojolicious, real-time web framework
taggg
 
Compiled Websites with Plone, Django, Xapian and SSI
Wojciech Lichota
 
Exploiting the newer perl to improve your plugins
Marian Marinov
 
EXPath: the packaging system and the webapp framework
Florent Georges
 
W3af
vjbala
 
Os Pruett
oscon2007
 
The Django Web Application Framework 2
fishwarter
 
Ad

Recently uploaded (20)

PPTX
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
PDF
Next level data operations using Power Automate magic
Andries den Haan
 
PPTX
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
PDF
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
PDF
Kubernetes - Architecture & Components.pdf
geethak285
 
PDF
Why aren't you using FME Flow's CPU Time?
Safe Software
 
PDF
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
PPTX
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
PDF
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
PDF
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
PPTX
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
PDF
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 
New ThousandEyes Product Innovations: Cisco Live June 2025
ThousandEyes
 
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
 
Next level data operations using Power Automate magic
Andries den Haan
 
The birth and death of Stars - earth and life science
rizellemarieastrolo
 
LLM Search Readiness Audit - Dentsu x SEO Square - June 2025.pdf
Nick Samuel
 
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
 
Kubernetes - Architecture & Components.pdf
geethak285
 
Why aren't you using FME Flow's CPU Time?
Safe Software
 
The Future of Product Management in AI ERA.pdf
Alyona Owens
 
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
 
Smarter Governance with AI: What Every Board Needs to Know
OnBoard
 
Simplify Your FME Flow Setup: Fault-Tolerant Deployment Made Easy with Packer...
Safe Software
 
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
 
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
 
Proactive Server and System Monitoring with FME: Using HTTP and System Caller...
Safe Software
 
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
 
Enabling the Digital Artisan – keynote at ICOCI 2025
Alan Dix
 
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
 
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
 
Understanding The True Cost of DynamoDB Webinar
ScyllaDB
 

Developing web apps using Erlang-Web

  • 1. Server-side web development Using ErlangWeb Stefan Comanescu
  • 2. A brief history of Erlang Initially developed by Joe Armstrong in 1986, as a proprietary language within Ericsson for usage in telephony applications
  • 3. Named after the Danish mathematician Agner Krarup Erlang
  • 4. First versions were running on a Prolog interpreter, a C emulator and a compiler were later written, for reasons concerning performance
  • 5. In 1997 bit syntax and binaries were added (for protocol programming) and in the same year work started on OTP
  • 6. Released as open source in 1998
  • 7. SMP support was added in 2006
  • 8. Why Erlang ? Concurrency Actor model (no threads, no locks, no shared memory, only asynchronous message passing) Fault Tolerance Process linking, supervising trees, distribution and event managers help in keeping the system going when processes crash. Distribution Abstracts the difference between local and distributed message passing
  • 9. Runs on Yaws or Inets web server
  • 10. MVC (Model-View-Controller) paradigm Model – data (stored in mnesia/dets tables) manipulation
  • 11. Templates – XHTML files and templating engine
  • 12. Controller – Erlang functions called on dispatching rules
  • 13. Dispatcher – Request routing based on regexp
  • 14. Request dictionary Reusable components (“ecomponent”)
  • 17. Directory structure For creating the directory tree of a new application, ./bin/add is executed which generates the directories:
  • 18. config –dispatch.conf, errors.conf, projects.conf, server specific .conf
  • 19. docroot –static files and folders (except html templates), e.g : js, css, img
  • 20. lib –framework applications and applications created by the user
  • 21. log –logs created while running in embedded mode and server specific log
  • 22. pipes –OS pipes for cummunicating with the shell while in embeded mode
  • 23. priv –project specific data (usually static html)
  • 24. release –separated subdirectories for each release version
  • 25. templates –all the template files templates/cache – cached files
  • 26. Generator script (bin/generate.erl) Module responsible for generating the boilerplate code
  • 27. General format: ./bin/generate.erl TYPE -argument_name -argument_value
  • 28. Generating a controller: ./bin/generate.erl controller --app app_name --name name_of_the_generated_model --functions (fun1, fun2)
  • 29. ./bin/generate.erl model --app app_name --name name_of_the_generated_model --hrl name_of_the_header_file Generates a file named wtype_name where 'name' is the given arg
  • 30. Generates basic CRUD functionality for the given header
  • 31. Dispatcher Dispatching types Static dispatching: serving static content, like xml pages, media or javascript. The controller is not accessed. The server first searches for the file in the “templates” dir, afterward in the “docroot” dir. For faster retrieval of static content, they should be placed in the docroot dir and enoent should be placed instead of File {static, Regexp, File} | {static, Regexp, enoent} Dynamic dispatching: the controller will handle the URL requests allowing specific content to be created or retrieved on demand {dynamic, Regexp, {Module, Function}} Alias dispatching: if the URL matches the Regexp, the rule of NewURL will be triggered {alias, Regexp, NewURL} Delegates: passing the URL to another dispatch config file, only helps in structuring the application {dynamic, delegate, Regexp, File}
  • 32. Dispatcher evaluation order Docroot content is served (files that point to 'enoent')
  • 33. Dynamic entries are matched with their URLs
  • 34. Static routes are matched
  • 35. If no patterns are matched, a 404 error page is displayed
  • 36. Request dictionary Temporary storage – created for each HTTP request, lives as long as the request lives
  • 37. Provides an easy to use API for setting and getting values from the dictionary
  • 38. Used for retrieving GET/POST request data from the query string and also used by the expanding templates
  • 42. Request dictionary Sample browser request {<0.3110.0>,[ {&quot;get&quot;,[]}, {&quot;post&quot;,[ {&quot;action_type&quot;,&quot;add&quot;},{&quot;id&quot;,[]},{&quot;type&quot;,&quot;user&quot;},{&quot;user_password&quot;,&quot;nuitizic&quot;}, {&quot;user_phone&quot;,&quot;07273447823&quot;},{&quot;user_cnp&quot;,&quot;1901231231723&quot;}, {&quot;user_lastname&quot;,&quot;alex&quot;},{&quot;user_firstname&quot;,&quot;popescu&quot;} ] }, {&quot;__https&quot;,false}, {&quot;__cookies&quot;,[{&quot;eptic_cookie&quot;,&quot;nonode@nohost-7985065742948673537&quot;}]}, {&quot;session&quot;,[{&quot;user_id&quot;,&quot;1111111111111&quot;}, {&quot;groups&quot;,[&quot;admin&quot;]}]}, {&quot;__path&quot;,&quot;admin/add&quot;}, {&quot;__cookie_key&quot;,&quot;nonode@nohost-7985065742948673537&quot;},{&quot;__ip&quot;,{127,0,0,1}}, {&quot;__controller&quot;,controller} ] }
  • 43. Controller Responsible for handling the user's requests
  • 44. Has the arity 1, getting a proplist (list of key-value pairs)
  • 45. Handles user input, model manipulation, etc.
  • 46. Must return a tuple, which tells the template what to do: {redirect, URL} | {content,html,Data} | {content,text,Data} | {json,Data} | {template,Template} | {error,Code} | {headers, Headers, RetVal} where : Headers is a list of headers, of the form {cookie, CookieName, CookieValue, CookiePath, CookieExpDate}
  • 47. Retval is one of the previous touples
  • 48. Templating Engine The view is represented by a regular XHTML file with a few namespaces defined.
  • 49. The most commonly used namespace, wpart, is always expanded by the framework . When the parser meets <wpart:lookup … /> for example, it will call the function wpart_lookup:handle_call/1, with the whole xmerl parsed tag as an argument.
  • 50. Templating Engine Wpart tags wpart:choose provides “if” functionality; it contains the tags: <wpart:when test=”...”> … </wpart:when>
  • 51. <wpart:otherwise> Something else </wpart:otherwise>
  • 52. The test is an expression of the form test=”1 + 1 eq 2”, where the operators can be: eq, neq, lt, le, gt, ge (for =:=, =/=, <, >, =<, >=)
  • 53. Templating Engine Wpart tags wpart:list provides “for” functionality; it contain the attributes: select, specified what part of the list we want, attributes: map – renders every element in the list
  • 54. head – renders only the first element
  • 55. tail – renders the last element of the list
  • 56. filter – has an attribute named “pred” for filtering the list
  • 57. find – the first element of the list where “pred” is evaled to true
  • 58. sort – sorts according to the “pred” attribute as, every element of the list from inside the wpart:list will be known as the value of this attribute
  • 59. Templating Engine Wpart tags list, specifies the list from the request dictionary that we want to traverse
  • 60. pred, predicate used for some of the select tags, it's optional
  • 61. e.g. : <wpart:list select=”map” list=”students” as=”student”> <span class=”name”><wpart:lookup value=”student:name”/></span> <span class=”group”><wpart:lookup value=”student:group”/></span> </wpart:list>
  • 62. Templating Engine Wpart tags wpart:lookup provides access to a value from inside the request dictionary, it contains the attributes: key, the key from the dictionary that we are looking for
  • 64. type, can have the values “text” (default) or “html”, setting “html” turns off html-escaping and can be dangerous
  • 65. e.g : <wpart:lookup key=”name”/> <wpart:lookup key=”student:name”/>
  • 66. Templating Engine (wtpl) Tool for faster building of html pages, by expanding or replacing content from other template files
  • 67. Allows building of websites from small chunks of html
  • 68. It helps with : Code re-usage
  • 69. Not writing the same thing multiple times
  • 70. Updating the common part of the pages only one time
  • 71. Templating Engine (wtpl) Wtpl tags <wtpl:include name=Name /> - the location where the wtpl:content with the corresponding name will be placed
  • 72. <wtpl:parent path=Path /> - specifies which template will be filled with the content provided by the wtpl:content content
  • 73. <wtpl:content name=Name/> - content that will fill the wtpl:include tag which has the same name as the tag 'name' attribute, in the file specified by wtpl:parent
  • 74. Templating Engine wpart_gen Enables building of HTML code directly from within Erlang modules.
  • 75. wpart_gen:load_tpl(Namespace, Name, Path) – loads the html snippet specified by Path, and saves it in the memory under the key {Namespace,Name}
  • 76. Tpl = wpart_gen:tpl_get(Namespace,Name) – gets the snippet from memory
  • 77. wpart_gen:build_html(Tpl,Values) – builds the template file with the values from the list Values
  • 78. Templating Engine wpart_gen – Template Format Anonymous slots: <!-- HTMLCode --> <% slot %> <!-- HTMLCode --> Named slots: <!-- HTMLCode --> <% name_of_the_slot %> <!-- HTMLCode -->
  • 79. Templating Engine wpart_gen – Passed Values Anonymous slots: [Value | … ] All fields must be filled. Named slots: [{ “slot_name”, Value} | … ] The unfilled slots will remain empty.
  • 80. Controlling cache persistent – data cached this way is not removed until the server is restarted or the cache is invalidated
  • 81. timeout – every T minutes the cache is traversed and expired content is removed, each URL can have a different timeout.
  • 83. Controlling cache The caching configuration is made directly from the dispatch configuration file. E.g. : {dynamic, “^/index/?$”,{main,home},[{cache,persistent}]}.
  • 87. Controlling cache For controlling cache based on aspects other than URL, the tuple {is_cachable_mod, my_mod} should be placed in the configuration(config/project.conf) file.
  • 88. Before processing any request, the function my_mod:is_cachable() will be called
  • 89. The function is_cachable() should return true if the request should be cached under the URL key
  • 90. {true,NewId} , if the request should be cached under NewId
  • 91. false , if we don't want to check the cache
  • 92. Annotations Available since version 1.3
  • 93. Allows separation of the target function from different types of functions, non-domain specific wrappers.
  • 94. e.g.: before making a post to a blog you should be logged in and your message should be checked for “bad words” maybe; after posting the message the cache should be invalidated and your post-count could be modified.
  • 95. Usual dataflow mechanisms can be used but it could make the code harder to read and repetitive.
  • 96. Annotations Controller Syntax % keeps the stored macros -include_lib(“blog/include/utils_annotations.hrl”). % before posting ?AUTHENTICATE([“administrator”]). ?CHECK(blog_post). % after posting ?INVALIDATE(posts). ?UPDATE(user). post(_Args) -> ...
  • 97. Annotations Annotation Module Syntax ?BEFORE. %% ?AFTER. annotation_name(AnnotationArg, TargetModule, TargetFunction, TargetFunctionArgs | TargetFunctionResult) -> Result Result :: {proceed, NewFunctionArgs | NewResult} | {skip, NewResult} | {error, {ErrorMod, ErrorFun, ErrorArgs}}
  • 98. Annotations Annotation Module Example ?AFTER. check (blog_post, _Mod, _Fun, _Args) -> case is_bad(wpart:fget(“post:msg”)) of true-> {skip, {redirect, “http://correctiveschool.org”}}; _-> {proceed, _Args} end.
  • 99. e_components e_components is a mechanism for extending the capabilities of the framework
  • 100. Erlang-Web comes with e_components for authentication, mnesia backup and for generating rss feeds
  • 101. To search for an e_component we can run ./bin/e_component search component_name, command that will list all available components matching the name and their description
  • 102. To install an e_component we run ./bin/e_component install component_name, the e_component is now copied in the lib folder of our application. ./bin/compile is now required, in order to compile the component's source files.
  • 103. e_components One more thing is required in order to use the component in our project: inserting a new tuple in the configuration file: {ecomponents, [{e_auth, []}, {e_auth_dets, []} ]}. After restarting the server we can verify that the components are running, by executing the function that lists all running applications : application:which_applications()
  • 104. e_components e_components is a mechanism for extending the capabilities of the framework
  • 105. Erlang-Web comes with e_components for authentication, mnesia backup and for generating rss feeds
  • 106. To search for an e_component we can run ./bin/e_component search component_name, command that will list all available components matching the name and their description
  • 107. To install an e_component we run ./bin/e_component install component_name, the e_component is now copied in the lib folder of our application. ./bin/compile is now required, in order to compile the component's source files.
  • 108.  
  • 109.