Highlighted

Problem with Application Scope

New Here ,
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

293

Likes

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

Problem with Application Scope

New Here ,
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

294

Likes

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
Jul 28, 2014 0
Adobe Community Professional ,
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().

Likes

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
Reply
Loading...
Jul 31, 2014 0
farDesi LATEST
Community Beginner ,
Aug 10, 2014

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Aug 10, 2014 0