• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Problem with Application Scope

New Here ,
Jul 28, 2014 Jul 28, 2014

Copy link to clipboard

Copied

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.


TOPICS
Advanced techniques

Views

338

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 31, 2014 Jul 31, 2014

Copy link to clipboard

Copied

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().

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Aug 10, 2014 Aug 10, 2014

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation