<servlet-mapping>
<servlet-name>FileServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Change it to this:
<servlet-name>FileServlet</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
Restart Tomcat. Now all your non-CFML files are served directly via Tomcat.
While developing and testing, it's often useful to have directory listings enabled so you can browse directories (particularly if you have directories full of example / test code). There's no way to enable that with Railo's FileServlet but you can do it for the default Tomcat Servlet by changing the listings setting in the global web.xml file (in Tomcat's conf/ directory):
<servlet-name>default</servlet-name>
<url-pattern>/</url-pattern>
</servlet-mapping>
<init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
<param-name>listings</param-name>
<param-value>true</param-value>
</init-param>
9 responses
1 Aaron Greenlee // May 8, 2009 at 3:44 AM
2 John Allen // May 8, 2009 at 7:23 AM
Thanks especially for the dir listing tip.
I'm really loving Railo. It is mind blowing fast.
3 Michael Offner // May 13, 2009 at 7:10 AM
you can call files in browser via mapping name:
http://localhost/myrailomapping/test.gif.
one bad thing (and the reasion that this servlet is not enabled by default) this servlet is not realy powerfull, it has no caching mechanisms,like most fileservlet impl have.
4 The Internet // Jun 4, 2009 at 4:56 PM
5 Sean Corfield // Jun 4, 2009 at 10:29 PM
6 The Internet // Jun 5, 2009 at 4:22 AM
7 Ken Clarke // Jan 11, 2011 at 11:18 AM
8 Sean Corfield // Jan 16, 2011 at 9:47 PM
9 Sean Corfield // Jan 16, 2011 at 9:48 PM