Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Fetch variable in cfm

New Here ,
Mar 10, 2010 Mar 10, 2010

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?

425
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Mar 11, 2010 Mar 11, 2010

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 18, 2010 Mar 18, 2010

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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 20, 2010 Mar 20, 2010
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources