Skip to main content
Giambattista Scivoletto
Participant
July 28, 2014
Question

Problem with Application Scope

  • July 28, 2014
  • 2 replies
  • 375 views

We use dynamic text on our websites.

The dynamic text available in different languages is stored in structures in the Application scope.  Each resource bundle has its own variable to store its variables.  They can be called using the following format:

#Application.StructName[Session.locale].Variable#

The first part is the name of the structure variable. With brackets, the variable for the locale is passed in, specifying which part of the structure to use. The last part is the specific variable within the resource bundle to use.

If we add new variables in the Application Scope will not be immediately seen. 

The application scope can easily be refreshed by calling any page in the website and adding “refresh” as a variable in the URL. 

This is the Application.cfc function to refresh the application scope:

<cffunction name="onRequestStart">
<cfargument name="requestname" required=true />    
        <!--- restart application scope --->
        <cfif structKeyExists(url,"refresh")>
        <cfset applicationStop()>  
        </cfif>           
</cffunction>

We have a problem on one of our site.

When we call any page with 'refresh' url the site goes down, it says 'Locale is undefined in Session...', ONLY for one of our sites. It does not happen with other sites.


That is driving us crazy.


Is there some cold fusion specialist that can sense in which direction to move to try to resolve the problem?


Thank you for your help.


This topic has been closed for replies.

2 replies

Participating Frequently
August 11, 2014

I'm assuming everything is being set in ApplicationStart... so why not simply call ApplicationStart on refresh... why do the stop?

BKBK
Community Expert
Community Expert
July 31, 2014

The relevant code to show us is where you set the value of session.locale. I am also curious to know how you 'refresh the application scope' in applicationStop().