{{ !articles[0].partner.isSponsoringArticle ? "Platinum" : "Portal" }} Partner

Running Servlets On ColdFusion

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


-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.

<title>This is a test CFM page calling a Servlet page</title>
<h1>This is a test CFM page calling a Servlet page named “testServlet”</h1>

-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)

Published at DZone with permission of {{ articles[0].authors[0].realName }}, DZone MVB. (source)

Opinions expressed by DZone contributors are their own.

{{ tag }}, {{tag}},

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

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks