From: Joe W. <jo...@gm...> - 2009-11-11 19:43:49
|
Hello all, One of the many powerful features of eXist 1.4 is URL Rewriting. I've attached a simple XQuery app, called URL Rewriting Helper v.1, which I'm hoping will help others in trying to understand the new URL Rewriting features of eXist 1.4. (See http://exist-db.org/urlrewrite.html for the main docs.) The tool helps you dissect URLs and see them the way eXist sees them. It shows the $exist:* variables and the key URL-related info from the request module. It also lets you try out "faux" directories and URL parameters in order to see what happens. Ultimately, it helps you create highly portable XQuery apps, by avoiding the route of hard-coding paths. You can also easily use this to diagnose issues with other controllers - just paste the dispatch element from the controller.xql file into your own. The .zip file contains a folder ("url-rewriting-helper"), which contains two files ("controller.xql" and "url-rewriting-helper.xql"). You can place the folder either in your webapp directory, or in your db (I'd suggest /db/www/) -- anywhere that is part of a "controller hierarchy" as explained in the main docs. Then call, for example: localhost:8080/url-rewriting-helper/ or localhost:8080/tools/url-rewriting-helper/. If you have any questions or comments, please let me know. Thanks, Joe |