RE: [coldbox:8763] Tuckey URLReWrite

I have no experience with Tomcat outside of Java apps so take what I say with a grain of salt :slight_smile:

I don’t think you’ll need to do any URL rewriting unless you want to get rid of the “index.cfm” part of the URL. In general your servlet mapping will need to match the “.cfm/” pattern that Adobe puts in JRun’s web.xml. You mentioned you are using Tomcat as your servlet container, but what are you using as your app engine (OBD, Railo, Adobe CF)? I assume you are simply deploying a WAR or EAR?

Thanks!

~Brad

Hi Brad,

Thanks for coming back to me.

I’m using Railo, and it’s deployed from a WAR file.

I am looking to remove the index.cfm from the URL, so we can simply use http://mydomain.com/handler/event.

Thanks,

Robert

Also, I would love to add it to the bundle install directory if this is accomplished and also adding it to the SES guide online. Would love your collaboration!

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Thanks Luis!

From what I understand of the SES interceptor it uses CGI.PATH_INFO, is that right?

I have a feeling with Tuckey that this will be lost. And we’ll have to pass it along as URL.PATH_INFO.

Will I need to write a custom SESInterceptor for that? Or will the current one be smart enough?

I’m just looking through the source code at the moment.

Robert

You can use the URL Providers: http://wiki.coldbox.org/wiki/WhatsNew:3.0.0.cfm#SES_Interceptor_Updates

To modify the URI used by the SES interceptor before route detection occurs simple follow the convention of adding a UDF called PathInfoProvider to your Routes.cfm file. The PathInfoProvider() UDF is responsible for returning the string used to match a route. Without this UDF the SES interceptor will simply obtain the URI from the CGI.PATH_INFO variable.

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

I can’t pass an opportunity to plug a blog post on this very same issue: http://aarongreenlee.com/share/url-rewrite-tomcat/

I hit enter too quickly…

The blog post I shared some weeks back (http://aarongreenlee.com/share/url-rewrite-tomcat/) covers my setup for a ColdBox/Railo/Tomcat application using Tuckey.

Just copy the files from my post and you should be up and running right away.

Aaron Greenlee
http://aarongreenlee.com/

Aaron, can we add these to our bundle install folder so they are available in the distro?

Luis F. Majano
President
Ortus Solutions, Corp

ColdBox Platform: http://www.coldbox.org
Linked In: http://www.linkedin.com/pub/3/731/483
Blog: http://www.luismajano.com
IECFUG Manager: http://www.iecfug.com

Sure thing. I’ll make a pull request sometime soon.

Hi Aaron,

Thanks for sending me this link. I had actually seen your post already, however it doesn’t appear to be working for me, perhaps you can shed some light on it :slight_smile:

When I put your code in place, I get the following error when trying to it my project:

http://cl.ly/2y1Z3N160Y3o2f2n3f3x

Without your urlrewrite.xml in place the page loads just fine.

Any ideas?

Thanks,

Robert

Robert,

I think this may be an application mapping issue with your ColdBox setup. I assume you are trying to access the coldbox root?