|
|
| Author |
Message |
|
| Guest |
Posted: Tue Sep 05, 2006 8:42 pm |
|
|
|
Guest
|
Hi,
I'm reading Software Engineering for Internet Applications by P.
Greenspun et al. which describes "abstract urls". Basically, URLs
with no extension which the server tries to find a file for. In it's
simplest form, it tries extensions or directories. Is there a
facility like this built in to yaws? I've been messing around with
appmods to do this, but am wondering if there are any functions in
yaws which do this already.
I've had a look in the list archives, but couldn't find anything (yet).
Cheers,
Chris
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Tue Sep 05, 2006 9:32 pm |
|
|
|
Guest
|
On Tue, Sep 05, 2006 at 09:33:22PM +0100, Chris Campbell wrote:
> Hi,
>
> I'm reading Software Engineering for Internet Applications by P.
> Greenspun et al. which describes "abstract urls". Basically, URLs
> with no extension which the server tries to find a file for. In it's
> simplest form, it tries extensions or directories. Is there a
> facility like this built in to yaws? I've been messing around with
> appmods to do this, but am wondering if there are any functions in
> yaws which do this already.
>
> I've had a look in the list archives, but couldn't find anything (yet).
Hi Chris,
I've done something similar, but it's still somewhat primitive. I just
used arg_rewrite_mod to check for an existing file to serve static
content, and append ".yaws" if it wasn't already found.
I haven't decided if that's what I will stick with, as I was hoping to
do more dynamically, such as building internal URLs (and pages)
automatically. Still, the first test was easy and worked well enough.
Cheers,
Tim
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Sep 06, 2006 8:00 am |
|
|
|
Guest
|
Chris Campbell wrote:
> Hi,
>
> I'm reading Software Engineering for Internet Applications by P.
> Greenspun et al. which describes "abstract urls". Basically, URLs
> with no extension which the server tries to find a file for. In it's
> simplest form, it tries extensions or directories. Is there a
> facility like this built in to yaws? I've been messing around with
> appmods to do this, but am wondering if there are any functions in
> yaws which do this already.
I think appmods are the best way to implement this. Using appmods
we get explicit and detailed control over the URL.
/klacke
--
Claes Wikstrom -- Caps lock is nowhere and
http://www.tail-f.com -- everything is under control
cellphone: +46 70 2097763
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Erlyaws-list mailing list
Erlyaws-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/erlyaws-list
Post recived from mailinglist |
|
|
| Back to top |
|
| Guest |
Posted: Wed Sep 06, 2006 8:18 am |
|
|
|
Guest
|
I've done it using appmods like this.
%% root directory
resource_matcher([]) ->
fun root_resource/1;
%% root directory
resource_matcher(Url) when Url == "/" ->
fun root_resource/1;
%% matches "/desiredurl"
resource_matcher(Url) when Url == "/desiredurl" ->
fun desired_resource/1;
%% matches urls like "/url/123"
%% print some debug ionfo if match fails
resource_matcher(Url) ->
{Base, Id} = lists:split(length("/url/"), Url),
case Base of
"/url/" ->
url_resource(list_to_integer(Id));
_ ->
fun debug_data/1
end.
out(A) ->
Resource = resource_matcher(A#arg.appmoddata),
Resource(A).
filippo
Claes Wikstr |
|
|
| Back to top |
|
|
|
All times are GMT
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|
|