Are you running the developer edition of CFMX? If so, you may know that beyond running code yourself (as localhost or 127.0.0.1) you can also let up to one other IP address connect to the server. This is great for showing the results of some development to a client, etc.
But you can't just expect that IP address to be "removed" when the server is restarted. It's stored in a file and will remain there seemingly locking you in to only allowing that one IP address to visit your site.
The trick is just knowing where to change the value. In your [cfusionmx]/lib/license.properties file, delete the line:
allowedIP=nnn.nnn.nnn.nnn
Then restart the server.
Saturday, September 21, 2002
Friday, September 20, 2002
Getting to the Command Line in All Windows OS's
Ever need to run some command or batch file in Windows from the command line window, where you can see the response and enter still more commands?
It's pretty easy to get to the command line window in Nt 4, Win2k, and XP. Use Start>Run (or Windows key+r) and type "cmd". That opens a new window in which you can both enter commands and view their results.
But that approach doesn't work on Windows 95, 98, or ME. In those cases, you may feel you have to tell them to use Start>Programs>Command? or might it be MS-Dos Command? Who can keep track of these things, darn it. Take comfort. They can use the Start>Run approach. Here's the solution on Win 95/98/ME: it's just that they need to type "command" rather than "cmd".
Oh, and if you may be new to this stuff yourself, note that when you open the command window and are done, you can type "exit" to close the window.
By the way, if you haven't used this command line window to run programs and might instead type the command name in on the start>run prompt, just be aware that doing that won't let you see the response from the command, and may even make some other aspects of working with the command challenging. Consider using the "cmd" or "command" approach instead.
It's easy to presume that everyone knows these things, but often they don't.
Friday, September 13, 2002
Creating JSPs and Servlets in CFMX
Many may have missed that one of the cool new things in CFMX is that it allows integration of JSPs and servlets, meaning (for
one thing) that you can actually place them within the CFMX environment and run them, as well as pass control to them, share variables, andmore.
For instance, (in the Enterprise Edition only), you can place a JSP page in your CFMX web application directories right alongside your CF templates and calling it with a URL just like CFM page (using .jsp for the extension of course in the file name and the URL).
And servlets can be run as well, by placing them in the WEB-INF\classes directory and then calling them with:
http://yourdomain[:port]/servlet/ServletClassName
Those familiar with Servlets may know that sometimes you don't want to use the /servlet/ approach. You can create a virtual mapping instead by editing the file
[CFusionMXhome]\runtime\servers\default\SERVER-INF\default-web.xml.
To create a mapping for a servlet named SimpleServlet residing in the cfusionmx\wwwwroot\WEB-INF\classes directory, for instance, so that it could be called as /simple, just put the following in between the <web-app> element tags of that file:
<servlet>
<servlet-name>SimpleServlet</servlet-name>
<servlet-class>SimpleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimpleServlet</servlet-name>
<url-pattern>/Simple</url-pattern>
</servlet-mapping>
For more details on this sort of configuration, as well as on how to write and compile JSPs and servlets, see any good JSP/servlet book (including the fine JRun docs at livedocs.macromedia.com).
Those familiar with mapping virtual paths for servlets may also know that you can disabling the "servletinvoker". That's done by editing the file cfusionmx\runtime\servers\default\SERVER-INF\default-web.xml and commenting out the servlet definition for the ServletInvoker servlet.
One interesting aside is that while the Professional edition of CFMX specifically prevents execution of JSPs, it does not prevent execution of Servlets (of course, under the covers, CFML templates get converted to servlets in CFMX, so it may seem like there's no choice but that it should support them). But my reading of a few CFMX documents and the "edition comparison" suggests that running JSPs and servlets is an Enterprise-only feature. Be aware if running on Pro. Don't make any design/architecture decisions based solely on the fact that it "works", if it's against the license. I've reported this observation to Macromedia and am awaiting word.
one thing) that you can actually place them within the CFMX environment and run them, as well as pass control to them, share variables, andmore.
For instance, (in the Enterprise Edition only), you can place a JSP page in your CFMX web application directories right alongside your CF templates and calling it with a URL just like CFM page (using .jsp for the extension of course in the file name and the URL).
And servlets can be run as well, by placing them in the WEB-INF\classes directory and then calling them with:
http://yourdomain[:port]/servlet/ServletClassName
Those familiar with Servlets may know that sometimes you don't want to use the /servlet/ approach. You can create a virtual mapping instead by editing the file
[CFusionMXhome]\runtime\servers\default\SERVER-INF\default-web.xml.
To create a mapping for a servlet named SimpleServlet residing in the cfusionmx\wwwwroot\WEB-INF\classes directory, for instance, so that it could be called as /simple, just put the following in between the <web-app> element tags of that file:
<servlet>
<servlet-name>SimpleServlet</servlet-name>
<servlet-class>SimpleServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>SimpleServlet</servlet-name>
<url-pattern>/Simple</url-pattern>
</servlet-mapping>
For more details on this sort of configuration, as well as on how to write and compile JSPs and servlets, see any good JSP/servlet book (including the fine JRun docs at livedocs.macromedia.com).
Those familiar with mapping virtual paths for servlets may also know that you can disabling the "servletinvoker". That's done by editing the file cfusionmx\runtime\servers\default\SERVER-INF\default-web.xml and commenting out the servlet definition for the ServletInvoker servlet.
One interesting aside is that while the Professional edition of CFMX specifically prevents execution of JSPs, it does not prevent execution of Servlets (of course, under the covers, CFML templates get converted to servlets in CFMX, so it may seem like there's no choice but that it should support them). But my reading of a few CFMX documents and the "edition comparison" suggests that running JSPs and servlets is an Enterprise-only feature. Be aware if running on Pro. Don't make any design/architecture decisions based solely on the fact that it "works", if it's against the license. I've reported this observation to Macromedia and am awaiting word.
Beware of case in calling Java CFX custom tags
When calling a Java CFX custom tag in CFMX, it is now critical that the case of the tagname in the call to the tag (as in ) match the actual case of the tag as defined in the CF Administrator. This is a change of behavior from CF5 and is not mentioned in the docs on calling Java CFX custom tags (Chapter 12 of the "Developing ColdFusion MX Applications with CFML" book).
While it has indeed always been true in 4.52, 5, and MX that the case of the classname as specified in the Administrator had to match the name of the actual .class file, you could use any case for the call to the custom tag as in. Now, the case of the call must match the name specified in the Administrator as well. This could cause a problem for old code during migration, especially for any situations where the same tag is called using different "case" in multiple templates.
While it has indeed always been true in 4.52, 5, and MX that the case of the classname as specified in the Administrator had to match the name of the actual .class file, you could use any case for the call to the custom tag as in
Subscribe to:
Posts (Atom)
