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

Hi, what is the equivalent of Java request in Coldfusion?

New Here ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

Hi, what is the equivalent of Java request in Coldfusion?
Take for example, in java I'd have a doGet that has a request and response object. Then I can do:
request.setAttribute("name", "John");
RequestDispatcher rd = request.getRequestDispatcher("login.cfm");
rd.foward(request, response);

What is the Coldfusion equivalent of this? I've looked at some Coldfusion docs but I don't seem to understand it too well

Thanks so much,
C
TOPICS
Advanced techniques

Views

460

Translate

Translate

Report

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
LEGEND ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

the request scope is what you want, although it's not an object...it's just
another variable scope. so you treat it like a structure, like so:

request.name = "john";

are you looking just for request scope, or are you looking for how to do
page forwarding also?




"coldfuse228" <webforumsuser@macromedia.com> wrote in message
news:emtvo4$dtj$1@forums.macromedia.com...
> Hi, what is the equivalent of Java request in Coldfusion?
> Take for example, in java I'd have a doGet that has a request and response
> object. Then I can do:
> request.setAttribute("name", "John");
> RequestDispatcher rd = request.getRequestDispatcher("login.cfm");
> rd.foward(request, response);
>
> What is the Coldfusion equivalent of this? I've looked at some Coldfusion
> docs but I don't seem to understand it too well
>
> Thanks so much,
> C
>


Votes

Translate

Translate

Report

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 ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

currentPage.cfm
===============
<cfset request.name="John">
<cfset getPageContext().forward("login.cfm")>

login.cfm
========
Name in request scope = <cfoutput>#request.name#</cfoutput>

Votes

Translate

Translate

Report

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 ,
Dec 27, 2006 Dec 27, 2006

Copy link to clipboard

Copied

LATEST
Hi Marc E and BKBK, thank you so much for your replies!

Marc, I'm looking for both request scope, and how to do
page forwarding also.

BKBK, I'm going to try this out, thanks so much for sample code.

Thanks again,
C

Votes

Translate

Translate

Report

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
Documentation