3 Replies Latest reply on Dec 27, 2006 7:57 AM by coldfuse228

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

    coldfuse228 Level 1
      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
        • 1. Re: Hi, what is the equivalent of Java request in Coldfusion?
          Level 7
          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
          >


          • 2. Re: Hi, what is the equivalent of Java request in Coldfusion?
            BKBK Adobe Community Professional & MVP
            currentPage.cfm
            ===============
            <cfset request.name="John">
            <cfset getPageContext().forward("login.cfm")>

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

            • 3. Re: Hi, what is the equivalent of Java request in Coldfusion?
              coldfuse228 Level 1
              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