I am experiencing a strange problem when using getPageContext().forward(). I have a page that posts to a page called handler.cfm. In handler.cfm, I do error checking and if errors exist, I setup a structure that contains the error messages and the name of the field(s) in error. I also place all the form variables into the request scope and then call getPageContext().forward(). The call then displays the form again. Everything works correctly up to this point. HOWEVER, if I then attempt to go to any other page from this page (submit the form again or simply click on a link that specifies a simple cf page with no code on it), I receive:

Server Error
The server encountered an internal error and was unable to complete your request.
JRun closed connection.


I am using CFMX 6.1. I thought this might have something to do with the form bug that existed in earlier versions so I set form=structNew() to clear it out. Same problem.

Finnally, if I simply do a refresh on the page with the error, the problem goes away and the page that was supposed to be called finally gets displayed correctly.

Anyone have any ideas?

Thanks,

Alex Gadea
Apptik Inc.

This is the code I use to setup the server side forward:

<CFIF formObj.formIsInError>

     <cfscript>
          // need to get the form variables and the error structure into the request scope prior to forwarding
          request.form = form;
          form = structNew();
          request.generatedErrors = formObj.generatedErrors;
          getPageContext().forward(form.returnURL);
     </cfscript>

</CFIF>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to