Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Running Servlets On ColdFusion

DZone's Guide to

Running Servlets On ColdFusion

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

ColdFusion Technical Support Engineer Vikas Chandran explains how to run Java servlets on ColdFusion.

TO TEST

-Create a cfm page and call the Servlet [in our case the servlet name is "testServlet"] with content.

note we are using “GetPageContext().forward(“testServlet”);”

to forward the request to the servlet.

<html>
<head>
<title>This is a test CFM page calling a Servlet page</title>
</head>
<body>
<h1>This is a test CFM page calling a Servlet page named “testServlet”</h1>
<cfscript>
GetPageContext().forward(“testServlet”);
</cfscript>
</body>
</html>

-Create a Servlet name it “testServlet.java” with content testServlet[please refer the code mentioned at the end]

once you have compiled the Servlet.

(continued through link)

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}