Did you know that you can ask CFMX to save in source form the Java code it creates when compiling CFMX templates?
You do so by setting the parameter "coldfusion.compiler.saveJava" to TRUE in <cfmx_home>/wwwroot/WEB-INF/web.xml. Then restart the server.
Files are then saved as .java files in <cfmx_home>\wwwroot\WEB-INF\cfclasses\ directory. Be warned, though, the file names may not be apparent:
Setsession.cfm becomes cfsetsession2ecfm1011928409.java
Also, there's no obvious distinction between classes from templates of the same name in different directories.
Thursday, August 08, 2002
Anyone Else Notice the "Server Reports" Feature Missing in CFMX
Folks, I was surprised to discover today that the CF5 Enterprise Administrator feature called "Server Reports" is no longer available in CFMX (Enterprise/Trial/Developer editions).
It allowed you to monitor the CF performance statistics (those written to the NT Performance Monitor from within CF), providing a web-based interface that had some benefits over CFSTAT in some cases. Fortunately, that's still availalable, but I'd not seen any documentation of the removal of Server Reports. I just observed it today for the first time.
It allowed you to monitor the CF performance statistics (those written to the NT Performance Monitor from within CF), providing a web-based interface that had some benefits over CFSTAT in some cases. Fortunately, that's still availalable, but I'd not seen any documentation of the removal of Server Reports. I just observed it today for the first time.
Wednesday, August 07, 2002
Enabling dynamic class reloading in CFMX
By default, CFMX will NOT dynamically reload changed servlets and CFOBJECT classes. This is a performance optimization. In a development environment, you may want to change that.
In the file [cfmx_home]\wwwroot\WEB-INF\jrun-web.xml, add the following line within the existing <jrun-web-app> element:
<reload>TRUE</reload>
Restart the server. CFMX will now reload classes from [cfmx_home]\wwwroot\WEB-INF\classes as well as classes in jar/zip archives in [cfmx_home]\wwwroot\WEB-INF\lib.
Note: The [cfmx_home]\wwwroot\WEB-INF\classes directory must contain class files only, not class archives. Java class archives belong under the [cfmx_home]\wwwroot\WEB-INF\lib directory
update:
In the file [cfmx_home]\wwwroot\WEB-INF\jrun-web.xml, add the following line within the existing <jrun-web-app> element:
<reload>TRUE</reload>
Restart the server. CFMX will now reload classes from [cfmx_home]\wwwroot\WEB-INF\classes as well as classes in jar/zip archives in [cfmx_home]\wwwroot\WEB-INF\lib.
Note: The [cfmx_home]\wwwroot\WEB-INF\classes directory must contain class files only, not class archives. Java class archives belong under the [cfmx_home]\wwwroot\WEB-INF\lib directory
update:
I forgot to mention thetrue option as well. This will cause CF to automatically compile classes as well, when the class is requested. This is really a neat option since when compiling things yourself you need know how to get to the command line, run the java compiler, remember to provide the same classpath that CFMX would use when running the class, then remember to put the file in the correct directory. With this autocompile feature, CF not only does the compile for you but also uses its classpath and compiles it right where the source code exists. So for working with servlets, for instance, just put your servlet right in the WEB-INF/classes directory and call it, and CF will compile it for you if it's not already been compiled. And if it's been changed since last compiled and the reload and compile options are enabled, it will both compile and reload it. Nifty!
Comments and Corrections for CFMX Docs on Sandbox/Resource Security
In preparing for an upcoming article I'm doing on Sandbox/Resource Security (they're not quite the same thing) for the MM DesDev Center, I've found many misstatements and sources of misinformation in the CFMX docs on the subject. For more info, see the comments at the bottom of the relevant pages for these docs at livedocs.macromedia.com, "Administering CFMX" book (Chapter 4) and "Developing CFMX Apps" book (Chapter 16).
And look for the complete article clarifying the distinctions and providing how to's and more at the DesDev site in the future. I'll likely post some pertinent observations here as well.
And look for the complete article clarifying the distinctions and providing how to's and more at the DesDev site in the future. I'll likely post some pertinent observations here as well.
Subscribe to:
Posts (Atom)
