From: Ron V. d. B. <ron...@ka...> - 2012-01-11 12:09:18
|
Hi, In cutting loose my last Cocoon ties, I'm struggling with a nasty detail. I've found that adding a "jsessionid" path parameter to the URL causes problems to eXist's MVC mechanism (I'm testing with eXist-trunk, rev. 15640). (I need access to existing sessions for http:send-request() calls that export stored search results in a zip file. That's why I ended up adding the "jsessionid" path parameter to all <http:request> URLs passed to http:send-request().) This behaviour also occurs in the shipped eXist webapp, so I gather it might be broader than just my issue. Take, for example following URL: <http://localhost:8080/exist/urlrewrite.xml>, which correctly returns the MVC documentation page. However, when a jsessionid path parameter is added, as in <http://localhost:8080/exist/urlrewrite.xml;jsessionid=123>, the Jetty server returns a "404 not found" status. On Tomcat, this produces an error: javax.servlet.ServletException: An error occurred: Cannot forward after response has been committed org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:379) java.lang.IllegalStateException: Cannot forward after response has been committed org.exist.http.urlrewrite.Forward.doRewrite(Forward.java:47) org.exist.http.urlrewrite.XQueryURLRewrite.doRewrite(XQueryURLRewrite.java:560) org.exist.http.urlrewrite.XQueryURLRewrite.applyViews(XQueryURLRewrite.java:410) org.exist.http.urlrewrite.XQueryURLRewrite.doFilter(XQueryURLRewrite.java:354) According to the {$exist_webapps}/controller.xql file, this request is just forwarded to the XSLTservlet, which transforms the XML source with the db2xhtml.xsl stylesheet (see line 110 and following of <http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/webapp/controller.xql?revision=14656&view=markup>). OTOH, it appears that the jsessionid path parameter *is* honoured for requests that are forwarded to the XQueryServlet. Take for example <http://localhost:8080/exist/urlrewrite.xml;jsessionid=123?q=.>. Here, the "q" request parameter causes the request to be forwarded to an XQuery script that will search this document from the db (see line 91 and following of <http://exist.svn.sourceforge.net/viewvc/exist/trunk/eXist/webapp/controller.xql?revision=14656&view=markup>). I found the same behaviour in my app: requests that are finally processed by the XQueryServlet are fine when the URL contains the "jsessionid" path parameter (and I can tell from my app that in those cases the sessions are accessed correctly). All others with fail when "jsessionid" is in the URL. I've tested with totally non-eXist related webapps on Tomcat by adding a "jsessionid" path parameter to the URL and all pass without problems, so I guess this really is an eXist issue. Does anyone know a fix/workaround (much appreciated!)? Kind regards, Ron -- Ron Van den Branden Wetenschappelijk attaché / Senior Researcher Reviews Editor LLC. The Journal of Digital Scholarship in the Humanities Centrum voor Teksteditie en Bronnenstudie - CTB (KANTL) Centre for Scholarly Editing and Document Studies Koninklijke Academie voor Nederlandse Taal- en Letterkunde Royal Academy of Dutch Language and Literature Koningstraat 18 / b-9000 Gent / Belgium tel: +32 9 265 93 51 / fax: +32 9 265 93 49 E-mail : ron...@ka... http://www.kantl.be/ctb |