tracker issue : CF-3707543

select a category, or use search below
(searches all categories and all time range)
Title:

Little to no documentation on interoperability of ColdFusion with servlets, and the little there is, is wrong

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): A. Bakia / A. Bakia (A. Bakia)

Created: 02/13/2014

Components: Documentation

Versions: 10.0

Failure Type:

Found In Build/Fixed In Build: Final /

Priority/Frequency: Normal / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 1

Problem Description: When you search ColdFusion 10 documentation, you will find little to no documentation on using servlets directly in ColdFusion. In fact, the little documentation there is wrong and contradicts the ColdFusion 9 documentation.

Steps to Reproduce: (1) Search the ColdFusion 10 documentation for the word servlet. You will find little to nothing on how to run servlets in ColdFusion 10. You will find, for example, https://wikidocs.adobe.com/wiki/display/coldfusionen/Interoperating+with+JSP+pages+and+servlets . This says: 

"... to run a servlet called HelloWorldServlet, you place the servlet .java or .class file in the _serverroot/_WEB-INF/classes directory and access the servlet with the URL /servlet/HelloWorldServlet."  

Note that these instructions say nothing about declaring the servlet and servlet mapping in web.xml. This contradicts the ColdFusion 9 documentation in http://blogs.adobe.com/vikaschandran/2011/07/15/running-servlets-on-coldfusion-9-2/ .

Actual Result: Following the ColdFusion 10 instructions results in a 'File Not Found'.

Expected Result:  This bug should be rectified. Moreover, servlet interoperability should be extensively documented, as it is a cornerstone of Java integration. It is also important to document how to dynamically load servlets using ColdFusion 10's new Javasettings property.

Any Workarounds: Compile the java servlet, say HelloWorldServlet.java, into a class file. Copy the class file to {CF_ROOT}\WEB-INF\classes\. Open \WEB-INF\web.xml in a text editor and add the following:

<servlet>
<display-name>HelloWorldServlet</display-name>
<servlet-name>HelloWorldServlet</servlet-name>
<servlet-class>HelloWorldServlet</servlet-class>
</servlet>

<servlet-mapping>
<servlet-name>HelloWorldServlet</servlet-name>
<url-pattern>/HelloWorldServlet</url-pattern>
</servlet-mapping>

Restart ColdFusion. The servlet can then be accessed in ColdFusion through the URL /HelloWorldServlet, for example, 

getPageContext().forward("/HelloWorldServlet");

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3707543

External Customer Info:
External Company:  
External Customer Name: BKBK
External Customer Email:  
External Test Config: My Hardware and Environment details:

Attachments:

Comments:

Agreed / subscribing. -- Adam
Vote by External U.
13520 | February 15, 2014 06:36:13 PM GMT
I'm get this info ready.
Comment by Frank J.
13513 | May 09, 2014 03:04:45 AM GMT
I've added a new section, Running Servlets in ColdFusion. The link to access the document is https://helpx.stage.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/integrating-jee-and-java-elements-in-cfml-applications/interoperating-with-jsp-pages-and-servlets.html Please check and validate.
Comment by Saurav G.
13514 | September 21, 2015 06:18:08 AM GMT
Thanks, Saurav. I get: Access Denied You don't have permission to access "http://helpx.stage.adobe.com/coldfusion/developing-applications/using-web-elements-and-external-objects/integrating-jee-and-java-elements-in-cfml-applications/interoperating-with-jsp-pages-and-servlets.html" on this server. Reference #18.68a9645f.1442840309.195a545e
Comment by External U.
13515 | September 21, 2015 07:29:53 AM GMT
Adobe is migrating the wiki to Adobe Experience Manager. They will eventually push the new docs from staging to production. (learned of this from an Adobe's comment on CF-3315068) Thanks!, -Aaron
Comment by External U.
13516 | September 23, 2015 12:31:53 AM GMT
Saurav, You provided a URL and requested us to check and validate. I did. Result: Access Denied. What next?
Comment by External U.
13517 | September 23, 2015 03:54:16 AM GMT
Will update soon.
Comment by Saurav G.
13518 | September 23, 2015 10:00:32 AM GMT
OK, thanks.
Comment by External U.
13519 | September 23, 2015 12:31:31 PM GMT