Just to add to Sean's advice here, you also need a way to refer to non-cf resource in a way that excludes the context root. For instance, of you click on a link that goes to...
/cfmx/path/to/my/file.cfm ... with "cfmx" being the context root, and that page tries to reference an image using... <img src="images/foo.gif" /> ... then your image will be broken because there is no actual directory called cfmx/path/to/my/images/. Anyway, I put together a few UDFs which build appropriate paths using a technique similar to what Sean has posted here, and I'm trying to gauge how useful they are and how widely they should be used in applications that are intended to run with different configurations. I will post them on my weblog once I'm done testing them. Christian On Wednesday, March 19, 2003, at 10:41 PM, Sean A Corfield wrote: > On Wednesday, Mar 19, 2003, at 09:29 US/Pacific, Christian Cantrell > wrote: >> I'm wondering how many of you use CFMX with JRun (or another J2EE >> server) and use a context root other than "/". In other words, how >> many of you have to use /cfusion or /cfmx to access your ColdFusion >> pages? I'm wondering because this type of configuration can affect >> the >> way sample applications are distributed. > > A useful tip: > > CFMX applications can be written to work regardless of the actual > context root: > > In Application.cfm (for example): > > <cfparam name="request.contextRoot" > default="#getPageContext().getRequest().getContextPath()#"> > > Then use #request.contextRoot# wherever you need to construct a > root-relative URL: > > <a href="#request.contextRoot#/path/to/myfile.cfm">link</a> > > Sean A Corfield -- http://www.corfield.org/blog/ > > "If you're not annoying somebody, you're not really alive." > -- Margaret Atwood > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

