Author: Steven Neiland
Published:

Warning: This blog entry was written two or more years ago. Therefore, it may contain broken links, out-dated or misleading content, or information that is just plain wrong. Please read on with caution.

I recently setup a mangoblog site on my railo server for a friend. At first glance everything seemed fine, but after clicking around I started to get errors. A quick internet search revealed that I had to modify my web xml file to add additional servlet mappings.

Add Mappings To Web xml

Open up the web xml file. The below command is for linux systems, for windows just open with notepad.

vi /[path]/[to]/railo/tomcat/conf/web xml

Scroll down and add the following to the servlet mappings section.

<servlet-mapping>
<servlet-name>CFMLServelet</servlet-name>
<url-pattern>/page.cfm/*</url-pattern>
<url-pattern>/post.cfm/*</url-pattern>
<url-pattern>/archives.cfm/*</url-pattern>
<url-pattern>/feeds.cfm/*</url-pattern>
<url-pattern>/author.cfm/*</url-pattern>
</servlet-mapping>

Save your changes and restart railo.

Regex Wont Work

Looking at the patterns of the urls you would think you could use regex. For some reason though I could not get it to work. Here is my attempt, if anyone who uses tomcat can tell me how to get this pattern to work in web xml or what im doing wrong I would appreciate it.

<servlet-mapping>
<servlet-name>CFMLServelet</servlet-name>
<url-pattern>/([a-zA-Z0-9]+).cfm/*</url-pattern>
</servlet-mapping>

No Function getDataAccessFactory

When you first try to login to mangoblog you may get an error like this.

Error: onRequestStart: component [Mango] has no function with name [getDataAccessFactory]

I dont know what causes this but all you need to do to fix this is simply restart Railo.

What Do You Think?

Reader Comments

Todd Rafferty's Gravatar
Todd Rafferty
Tuesday, March 27, 2012 at 2:58:04 PM EDT

Regex doesn't work in web.xml in Tomcat at all to my knowledge. Did you find information online that lead you to believe that it did? If so, where?

You'd have to use this: http://www.tuckey.org/urlrewrite/
or Resin ( http://www.caucho.com/resin-application-server/ )

Steven Neiland's Gravatar
Steven Neiland
Wednesday, March 28, 2012 at 2:43:40 PM EDT

I remember seeing somewhere that regex was part of the spec, but it may have been pulled. It certainly has never worked for me but I put it down to myself doing something wrong.

Thanks I'll try those.

Post a Comment

Comment Etiquette:

  • Please keep comments on-topic.
  • Please do not post unrelated questions or large chunks of code.
  • Please do not engage in flaming/abusive behaviour.
  • Comments that contain or appear to be advertisments, will not be published.
  • Comments that appear to be created for the purpose of linkbuilding to commercial sites will be removed.

We are all adults here so play nice.

*
*



Archives Blog Listing

Tag Listing

Learn CF In A Week

 
Fork me on GitHub