I have an Apache webserver, which connects to tomcat+railo via mod_jk. This works.
<VirtualHost *:80>
ServerName localhost
DocumentRoot /developing/somesite/
ErrorDocument 404 /404error.cfm
</VirtualHost>
Now, if I call a non-existing page
http://localhost/page-does-not-exist, then Apache creates some extra "cgi variables", for example "cgi.redirect_url" and "cgi.redirect_query_string", and then calls the 404 handler /404error.cfm.
The code in 404error.cfm then checks those cgi variables to determine which url was requested, and then does other stuff, like showing a 404.
Now, in this mod_jk setup, these variables seemed to be gone. They are always an empty string (as with all undefined cgi vars).
So I tried using "JkEnvVar" in Apache's httpd.conf, to explicitly send those cgi vars, but that didn't help. I asked mister google for another 100 options, but didn't help.
Then I dug a little deeper, and checked the request itself:
<cfdump var="#getPageContext().getRequest().getAttribute('REDIRECT_URL')#" />
That gave a Null back.
But it had an interesting method getOriginalRequest(), so I tried:
<cfdump var="#getPageContext().getRequest().getOriginalRequest().getAttribute('REDIRECT_URL')#" />
And voila! There it was: "/page-does-not-exist".
This originalRequest is of type "org.apache.catalina.connector.RequestFacade" btw,a nd the getRequest is of type "railo.runtime.net.http.HTTPServletRequestWrap".
So now I know where I can digg those variables up, so my 404 page will work. But here's the question: shouldn't these variables already be available in the cgi scope? I think they should, because that's how it works when I used ACF / Resin+Railo behind an Apache webserver. Should it be seen as an error? I know that it will break some people's 404 code, especially if mod_jk will be used in the default railo installs.
Any insight on this is greatly appreciated.