Skip to main content
Known Participant
December 27, 2006
Question

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

  • December 27, 2006
  • 2 replies
  • 531 views
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
This topic has been closed for replies.

2 replies

Known Participant
December 27, 2006
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
Inspiring
December 27, 2006
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
>


BKBK
Community Expert
Community Expert
December 27, 2006
currentPage.cfm
===============
<cfset request.name="John">
<cfset getPageContext().forward("login.cfm")>

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