Scott Barnes wrote:

Q. What are the bads for having your CFC's exposed to the web? ie:

www.spidaweb.com/myApp/
www.spidaweb.com/myApp/packages/
www.spidaweb.com/myApp/packages/module/blah.cfc

www.spidaweb.com/myApp/views/
www.spidaweb.com/myApp/views/index.cfm

There are plenty of reasons not to expose more than necessary under the webroot - in some cases Application.cfm is no defence, I've seen sourcecode downloaded sometimes when the JRun server isn't running. I suppose the reasons you would want to do this are to either:


a) Expose components with remote methods, or
b) Make deployment easier with everything under a single directory tree.

For (a) the number of classes exposed should be very limited - you may want to arrange these in a package directory structure but the bulk of your classes, tags and includes would still be outside the webroot.

For (b) if you're using the JRun version of CF you have a very handy WEB-INF directory that cannot be browsed. You can put your packages in here safely and deploy them in one lump with your webroot stuff (and in fact your entire CF/Flex whatever installation).

What do I do (not claiming best-practise) is keep all my cfcs, includes and custom tags in a package tree outside the web root. If I have full control of the server I set the "/" mapping to the root of my package tree, then I can refer to all the packages I use without creating a cast of thousands on the mapping page: com.rocketboots.VCard, org.camden.blog.Blog. If it's a J2EE install sometimes I put the package tree in WEB-INF/classes. If I'm on a shared server I ask for the /com, /org etc mappings instead of the / mapping on the directories immediately below the top of the tree - if you're the first to ask you can get them (and if you're on AusTiger's mighty shared server, don't bother, I've got them already :-).

BTW, I keep my includes and custom tags in the package hierachy alongside my cfcs - often in an includes/ or tags/ directory - you can sort of think of them as static methods of an includes or tags class that way.


------------------------------------------------- Robin Hilliard Partner RocketBoots Pty Ltd Professional Services for Macromedia Technologies m +61 418 414 341 f +61 2 9798 0070 e [EMAIL PROTECTED] w http://www.rocketboots.com.au -------------------------------------------------


--- You are currently subscribed to cfaussie as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED] Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to