show request URL in 404 handler - my solution

10 views
Skip to first unread message

Bryan Hunt

unread,
Apr 27, 2015, 11:26:54 AM4/27/15
to chica...@googlegroups.com

In my previous post, I asked how to show the requested URL in a 404 handler. I had not noticed the use of paramterized modules in this project.

First my controller:

-module(training_world_controller, [Req]).
-compile(export_all).

%aka 404
lost('GET',[]) ->
    {ok, [ { original_path, Req:path() } ]    }.

Then the template file:

<html>
    <head>
        <title>File not found</title>
    </head>
    <body>
        The requested path {{ original_path }} was not found.
    </body>
</html>

Reply all
Reply to author
Forward
0 new messages