|
From: Joe W. <jo...@gm...> - 2008-12-01 13:14:14
|
Hi eXist list, I'm about to launch into some work to try to achieve URL Rewriting with Jetty/eXist, and I wanted to ask if the list would suggest accomplishing this (1) by using Jetty's Rewrite Handler or (2) by using the XQueryURLRewrite component Wolfgang has discussed before (see below). My goal is to rewrite eXist REST URLs from: historicaldocuments.xq?volume=frus1969-76v17&id=d1 which displays document 1 (d1) from frus1969-76v17.xml to something more like: historicaldocuments/frus1969-76v17/d1 I really like what I've read about Wolfgang's XQueryURLRewrite component, since it's all XQuery-based. Is that ready to tap into? I'm building from trunk. I see in WEB-INF/web.xml, XQueryURLRewrite is "disabled by default" -- so I could enable that; and I see webapp/redirector has two files that demo this functionality -- but I don't understand which file to view first/second. Any pointers would be great. Thanks, Joe Back in August, Wolfgang posted a few comments about URL Rewriting that he was incorporating into eXist: On Wed, Jul 9, 2008 at 5:31 AM, Wolfgang <wo...@ex...> wrote: > I wrote a component (XQueryURLRewrite) for the AtomicWiki project, which > deals with URL rewriting/forwarding. In the wiki, most URLs translate to one > main XQuery script. XQueryURLRewrite handles that and many other cases. The > code does already ship with the latest eXist distributions, but it still > needs a bit of tuning (to minimize the overhead) and documentation. I > planned to finish this soon. > > The component works similar to the urlrewrite Java package > (http://tuckey.org/urlrewrite/), but does all the URL parsing and rewriting > in XQuery. It basically implements a filter which passes all HTTP requests > to an XQuery and the return value of that XQuery determines how the HTTP > request is handled. This way, I don't need to struggle with another complex > XML configuration language, but just use eXist's HTTP XQuery modules. Also, in the Atomic Wiki, he wrote: by wolf at 25-8-2008 18:04; Wiki ID: MVCFramework > MVC Framework > I'm working to extend my XQueryURLRewrite servlet filter into a (very) basic model-view-controller framework inspired by django > or similar products. XQueryURLRewrite is used by AtomicWiki to map URL spaces to XQueries. It does so by calling a controller > XQuery, which tells the servlet filter how the request should be processed. The request can be sent to another servlet or path or > even an XQuery function. > > The next step would be to allow a view to be applied to the response. The view could again be a servlet or another XQuery > function. I'd also point to Dan McCreary's page on URL Rewriting: http://en.wikibooks.org/wiki/URL_Rewriting |