Copy link to clipboard
Copied
I have a String variable in JSP that I would like to forward to a ColdFusion 8 web page.
I tried forwarding the variable to ColdFusion and it doesnt show anything in the page.
Please advise how I can fetch a JSP variable in ColdFusion?
Copy link to clipboard
Copied
Take a look at the ColdFusion documentation.
"Interoperating with JSP pages and servlets"
http://help.adobe.com/en_US/ColdFusion/9.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-786c.html
Copy link to clipboard
Copied
Thanks, I am using ColdFusion 8 and I tried both attempts below where the hello.jsp is a simple hello world message:
<cfscript>
GetPageContext().include("http://myserver:8080/myapp/hello.jsp");
</cfscript>
and
<cfoutput>
#GetPageContext().include("http://myserver:8080/myapp/hello.jsp")#
</cfoutput>
Both came back with error on the GetPageContext() method with no further explanation of the ColdFusion error.
Please advise.
Copy link to clipboard
Copied
Use a relative URL instead. Here is an example I gave in a previous thread on JSP:
TimeNow.jsp
==========
<%
java.util.Date thisDate = new java.util.Date();
%>
Hello World, the time is now <%= thisDate %>
getTheTime.cfm
============
<cfset theTime = getPageContext().include("TimeNow.jsp")>