<CFSERVLET CODE="class name of servlet" JRUNPROXY="proxy server" TIMEOUT="timeout in seconds" WRITEOUTPUT="Yes" or "No" DEBUG="Yes" or "No"> <CFSERVLETPARAM NAME="parameter name" VALUE="value" > ... </CFSERVLET>
Executes a Java servlet on a JRun engine. This tag is used in conjunction with the CFSERVLETPARAM tag, which passes data to the servlet.
Required. The class name of the Java servlet to execute.
Optional. Specifies a remote machine where the JRun engine is executing. By default, the JRun engine is assumed to be on the host running ColdFusion. To indicate the name of a remote host, specify the IP address of the remote host followed by a colon and the port number at which JRun is listening. By default, for the JCP server, JRun 2.3.3 listens at port 8081; JRun 3.0 listens at 51000.
Optional. Specifies how many seconds JRun should wait for the servlet to complete before timing out.
Optional. Boolean specifying if the text output of the tag should appear as inline text on the generated page or if it should be returned inside a ColdFusion variable for further processing . The default value, YES, means output is returned as text to appear inline on the generated page. Setting it to NO means no visible text is returned but, instead, the text is returned as the value of the CFSERVLET.OUTPUT variable. See the CFSERVLET Variables table under Usage for more information.
Optional. Boolean specifying whether additional information about the JRun connection status and activity is to be written to the JRun error log. The error log is in JRunHome/jsm-default/logs/stderr.log. Reading this log is helpful for debugging server-side problems. The default is No.
The syntax of the CFSERVLET tag is designed to be consistent with the HTML markup
CFSERVLET Variables | |
---|---|
Variable Name | Description |
CFSERVLET.Output | Inline text output of the servlet is directed to this structure if the WRITEOUTPUT attribute is set to No. |
CFSERVLET.servletResponseHeaderName | The CFSERVLET return structure also contains the values of any response headers returned by the servlet. To access a response header, specify its name in servletResponseHeaderName. |
Note: The servlet must exist somewhere in the class path of the JRun engine executing the servlet. For JRun 2.3.3, the JRun "servlet" subdirectory is a good location since it's already in JRun’s class path and because classes in this directory are automatically reloaded by JRun if they change. For JRun 3.0, store servlets in jrun/servers/default/default-app/WEB-INF/classes.