From: Ron V. d. B. <ron...@ka...> - 2009-11-22 02:27:24
|
Hi, As a first step of switching to eXist 1.4, I'm migrating my applications, all of which are Cocoon-based. Currently, I'm a bit puzzled about the way to bypass eXist's controller framework. Following evidence suggests that this is controlled from controller.xql: 1. the entry in %EXIST_HOME%\webapp\WEB-INF\web.xml: <!-- IMPORTANT: the XQueryURLRewrite servlet filter does now serve as a single entry point into the web application. All eXist-related URL mappings are handled by XQueryURLRewrite (see controller-config.xml). The servlet mappings below are thus commented out. We keep them here for documentation purposes. If you need to switch to the old setup, you can re-enable the mappings below and disable them in controller-config.xml. However, please note that some features of the website will only work if XQueryURLRewrite controls the /rest servlet (EXistServlet). --> <filter-mapping> <filter-name>XQueryURLRewrite</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> 2. the entry in %EXIST_HOME%\webapp\controller.xql: (: ignore Cocoon :) else if (matches($exist:path, "/cocoon")) then <ignore xmlns="http://exist.sourceforge.net/NS/exist"> <cache-control cache="yes"/> </ignore> However, when I add a new webapp (say 'myapp'), and add a similar <ignore> instruction when $exist:path matches '/myapp', browsing to myapp produces a 404 error in the browser: HTTP ERROR: 404 Not Found RequestURI=/exist/myapp/test.xml On closer inspection, however, the web.xml file also contains following entry: <servlet-mapping> <servlet-name>Cocoon</servlet-name> <url-pattern>/cocoon/*</url-pattern> </servlet-mapping> It seems that this is the necessary AND minimal condition for directing URLs with /cocoon/ to be handled by Cocoon. If this servlet-mapping is repeated for '/myapp', http://localhost:8080/exist/myapp/test.xml is processed properly (ie. by Cocoon). From this, it seems that: 1. web.xml is the sole place to specify what content should be served from Cocoon instead of eXist controller framework 2. the <ignore> instruction in controller.xql has no effect at all (when the URL is specified in web.xml to be treated by Cocoon) Is this correct: is web.xml the sole place to indicate content to be served from Cocoon, and that controller.xql has no influence on this at all? Kind regards, Ron Van den Branden -- Ron Van den Branden Wetenschappelijk Attaché Centrum voor Teksteditie en Bronnenstudie (CTB) Koninklijke Academie voor Nederlandse Taal- en Letterkunde (KANTL) Koningstraat 18 B-9000 Gent Tel: +32 9 265 93 53 / Fax: +32 9 265 93 49 E-mail : ron...@ka... www.kantl.be/ctb |