SES URLs in Railo with Tomcat

I am setting up a copy of Codex Wiki on Railo with Tomcat.

Codex uses URLs that have the form:

http://domain/index.cfm/wiki/dashboard

This causes an error such as:


HTTP Status 404 - /index.cfm//wiki/dashboard
type Status report
message /index.cfm//wiki/Dashboard
description The requested resource (/index.cfm//wiki/dashboard) is not available.
Apache Tomcat/6.0.20

The default install of Railo I am using enables the handling of URLs such as:

*.cfm
*.cfml
*.cfc

But we need to also set up a handler for:

/index.cfm/*

These mappings are handled in the tomcat web.xml file.

The default settings are:

<!-- The mapping for the Railo servlet -->
 
<servlet-mapping>
	<servlet-name>CFMLServlet</servlet-name>
	<url-pattern>*.cfm</url-pattern>
</servlet-mapping>
 
<servlet-mapping>
	<servlet-name>CFMLServlet</servlet-name>
	<url-pattern>*.cfml</url-pattern>
</servlet-mapping>
 
<servlet-mapping>
	<servlet-name>CFMLServlet</servlet-name>
	<url-pattern>*.cfc</url-pattern>
</servlet-mapping>

We need to add one more that reads:

<servlet-mapping>
	<servlet-name>CFMLServlet</servlet-name>
	<url-pattern>/index.cfm/*</url-pattern>
</servlet-mapping>

After restarting Railo, the SES URLs should start working.

This technique should hopefully work for any applications that use this URL technique, including Mango Blog, which will require a few extra similar mappings.

This entry is based on a comment by Tony Garcia on a Railo entry by Sean Corfield:

http://corfield.org/entry/Railo_for_Dummies_Part_IV_Appendix

http://corfield.org/blog/post.cfm/Railo_for_Dummies_Part_V

This entry was posted in Railo and tagged , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

One Comment

  1. Posted June 15, 2011 at 6:00 am | Permalink

    Ppl like you get all the bianrs. I just get to say thanks for he answer.