I was wondering if there was simple of of defining the default filename
extension naviserver looks for, like there is for "ns_param directoryfile" but
for any url where the filename extension isn't specified in the url.
For example, if you go to:
http://localhost/about
I want "about.adp" to be the file that is loaded.
I've done this in aolserver two ways:
1) with a 404 handler
2) or with a code path in request.c (see code sample below)
-john
====
/* john buckman added 4/14/06 */
/* check if should add default filename extension of .adp */
/* only if no / on end of url which indicates a directory */
char * dotpos;
if (ds2.string[ds2.length - 1] != '/') {
/* if not . in the entire url, or if there is a dot before the final /
(indicating a . in a
directory name, which is ok, then add the default filename extension */
dotpos = strrchr(ds2.string, '.');
if ((dotpos == NULL) || (strchr(dotpos, '/') != NULL)) {
Ns_DStringAppend(&ds2, ".adp");
/* Ns_Log(Notice, "added default extension to get '%s'", ds2.string); */
}
}
/* end john buckman added */
request->url = ns_strdup(ds2.string);
===
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
naviserver-devel mailing list
naviserver-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/naviserver-devel