Archive for April 5th, 2004

05
Apr

Back from FlashintheCan

Just got back from FlashintheCan. All I can saw is wow, what a great conference it was. Shawn and the rest of the team put a lot of work into the conference and it showed. It was my first time at Fitc and will definitely be on my list of conferences to go to next year.

My presentation and Ask the Pros session went pretty well. I will be posting my presentation material tomorrow and will include some details on sessions/event in a separate blog entry tomorrow too. Right now I need some much needed sleep!

05
Apr

Workaround for “wrong name” error integrating CFML and JSP

We recently added a JSP page to one of our CFML applications. Everything was working fine until one of us typed in the full path to the application instead of using a bookmark, at which point we got this error:

500 jrun__move2test__act_checkout2ejspd
(wrong name: jrun__Move2Test__act_checkout2ejspd)

The problem is that JSP applications, at least running under JRun, are case sensitive in matching the entire file name including the path. In our case we’re not concerned with the file name of the JSP page itself since the user never sees it; it’s used intenrally. However, the user can type in the path and that is what’s causing the problem.

To address this issue we came up with a short routine that checks the path entered by the user against the real path for differences in case. If there is a difference it relocates, correcting the case. This will cause form submissions to fail if the problem is with your own code using the wrong case but works fine for pages where the user enters the URL directly.

function getPathFromFilePath(filePath) {
var l = len(getFileFromPath(filePath));
if (l) {
return left(filePath, len(filePath) - l);
} else {
return filePath;
}
}

Macromedia has a technote about capitalization in JRun.