Viewing Individual Entry / Main
  ::   October 7, 2002

Bug with CFIMPORT and ColdFusion Mappings
I'm not sure if anyone else has already blogged this or filed it as a bug with Macromedia (I went ahead and filed it today), but there's a bug in the CFIMPORT tag when trying to import tags from a directory that's outside the web root directory. Normall, ColdFusion allows you to create mappings just for this reason--so that you can have tags like CFINCLUDE get files from outside the webroot withough having to expose those templates via URL. Basically, CFIMPORT is ignoring any mappings you set in the ColdFusion Administrator.

For example, if I create a directory for my custom tags that's outside of the /wwwroot (and not under the /web-inf directory), CFIMPORT ignores the mapping. So, the following code fails assuming my webroot is e:\inetsrv\intranet\wwwroot and my mapping is to e:\inetsrv\intranet\web-sys

The error I get is that:

Could not import the tag library specified by /web-sys/customtags/ui. The following error was encountered: E:\inetsrv\intranet\wwwroot\web-sys\customtags\ui

Now, if I put a template in that same directory and CFINCLUDE it, it works fine. This tells me that there's a bug in CFIMPORT seeing the mapping.

There are two "workarounds" to this. The first is to put the tags you want to import into the WEB-INF directory. I prefer not to do this because this is a directory CFMX creates in it's own directory structure, and it's location will vary depending on where you install CFMX. I'd also hate to see CFMX overwrite any of my files or directories at a later point.

The second workaround is to create the mapping in the jrun-web.xml file in addition to the CF Administrator like this:

/web-sys E:/inetsrv/intranet/web-sys

That works, but is obviously a problem for applications that need to be easily deployed to different servers and environments. I shouldn't have to manually edit a CFMX config file. Hopefully, this is something that's easy for Macromedia to fix and can be included in the next CFMX Updater.



Calendar
Sun Mon Tue Wed Thu Fri Sat
          1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31            

Recommended Reading
The Cuisine of Hubert Keller

Archives by Subject
Announcements (28)
ColdFusion (61)
Database (12)
Dreamweaver (1)
Flash (2)
Flash Remoting (2)
Flex (3)
General Development (2)
Homesite + (1)
Mach-II (3)
MAX (9)
Mozilla (2)
Music (1)
Politics (1)
Portals (2)
Travel (2)

Search

Links
CFLib.org
Raymond Camden's Blog
Christian Cantrell's Blog
Sean Corfield's Blog
Nathan Dintenfass' Blog
Todd Rafferty's Blog
Steve Rittler's Blog
Cameron Childress's Blog

Credits
Based on blog.cfc by Raymond Camden

XML Feed