TurboManage

David Chandler's Journal of Java Web and Mobile Development

  • David M. Chandler


    Web app developer since 1994 and Google Cloud Platform Instructor now residing in Colorado. Besides tech, I enjoy landscape photography and share my work at ColoradoPhoto.gallery.

  • Subscribe

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 224 other subscribers
  • Sleepless Nights…

    March 2023
    S M T W T F S
     1234
    567891011
    12131415161718
    19202122232425
    262728293031  
  • Blog Stats

    • 1,039,383 hits

Archive for the ‘ColdFusion’ Category

ColdFusion meets AppEngine

Posted by David Chandler on December 10, 2009

What do you get when you combine the easiest Web language ever with the most powerful hosting platform ever?

Open BlueDragon for AppEngine

WatchPaul Kukiel’s short tutorial on setting it up.

Posted in AppEngine, ColdFusion | Leave a Comment »

Updated Web State Machine Code Supports Back Button

Posted by David Chandler on November 28, 2005

I’ve updated the Web state machine example from my earlier CFDJ article. You can find the updated code here:

WebStateMachine1_1.zip

It now implements the POST-REDIRECT-GET (PRG) pattern and uses a page token to allow the back button to work better. I also updated the following files:

  • sendEvent.cfm now appends pageToken to URL
  • choose_customer.cfm removed form action attribute to show that sendEvent adds it
  • choose_products.cfm removed form action attribute to show that sendEvent adds it

Refresh now works perfectly courtesy of PRG. The back button is trickier because when you click it, the browser actually loads its cached copy of the page, but what’s on the previous page no longer represents what’s stored in the user’s Session scope. So when you then click something on the page, you’re going forward again and will get to the right view state, but may see data from the future on your page. For example, in the sample app I’ve written, if you select two products, then use the back button, you will see a screen showing one product. But when you select another product, the page you get will show all THREE items you’ve now selected as far as the Session is concerned.

If you want to get really fancy, you can write code that keeps track of all the variables created in each state and “roll back” to your previous state by deleting any variables created forward from that point. Another possible solution is to use CFHTTPHEADER to set the no-cached directives. Then, when you click Back, the browser will be forced to make a trip to the server and the previous view will be shown with now current data.

If you get an error condition, you can display a hyperlink like “Resume what you were doing” with a link to flowctl.cfm. That will at least get the user back to the state that’s current on the server.

Good luck!
/dmc

Advertisement

Posted in ColdFusion | Leave a Comment »

Duplicate query column in WDDX causes CF5 server restart

Posted by David Chandler on May 12, 2005

In CF5, if you attempt to deserialize a WDDX packet containing a recordset (query) with a duplicate column name, it will stop the ColdFusion service! You will get a message in server.log: “Unknown error threshold reached. Restarting service.” In fact, the service is not completely restarted and responds to all subsequent requests with the same error message, causing the user to see “Server busy or unable to fulfill request.”

This is a huge bug in CFWDDX. If you’re using it to store queries in the Client scope, look out!

/dmc

Posted in ColdFusion | Leave a Comment »

Updated Example Code for CFDJ article on Web State Machine

Posted by David Chandler on November 23, 2004

Here is the complete example code that goes with my Web State Machine article in the October CFDJ.

Just unzip the files into your web root and set up a “Northwind” data source pointing to the Northwind sample database that comes with SQL Server. To run it, use http://localhost/WebStateMachine/flowctl.cfm?event=startFlow.

I’ve made a few improvements: notably, replacing the submit buttons with <input type=”button”> and using on onclick handler to call a JavaScript function that sends an event to the flow controller. This is less restrictive than using a named submit button, in which the event name is also the button text.

/dmc

Posted in ColdFusion | Leave a Comment »

 
%d bloggers like this: