[allowsmilie] => 1 [showsignature] => 0 [ipaddress] => [iconid] => 0 [visible] => 1 [attach] => 0 [infraction] => 0 [reportthreadid] => 0 [isusenetpost] => 1 [msgid] => [ref] => [htmlstate] => on_nl2br [postusername] => jgillies [ip] => webforumsuser@m [isdeleted] => 0 [usergroupid] => [membergroupids] => [displaygroupid] => [password] => [passworddate] => [email] => [styleid] => [parentemail] => [homepage] => [icq] => [aim] => [yahoo] => [msn] => [skype] => [showvbcode] => [showbirthday] => [usertitle] => [customtitle] => [joindate] => [daysprune] => [lastvisit] => [lastactivity] => [lastpost] => [lastpostid] => [posts] => [reputation] => [reputationlevelid] => [timezoneoffset] => [pmpopup] => [avatarid] => [avatarrevision] => [profilepicrevision] => [sigpicrevision] => [options] => [akvbghsfs_optionsfield] => [birthday] => [birthday_search] => [maxposts] => [startofweek] => [referrerid] => [languageid] => [emailstamp] => [threadedmode] => [autosubscribe] => [pmtotal] => [pmunread] => [salt] => [ipoints] => [infractions] => [warnings] => [infractiongroupids] => [infractiongroupid] => [adminoptions] => [profilevisits] => [friendcount] => [friendreqcount] => [vmunreadcount] => [vmmoderatedcount] => [socgroupinvitecount] => [socgroupreqcount] => [pcunreadcount] => [pcmoderatedcount] => [gmmoderatedcount] => [assetposthash] => [fbuserid] => [fbjoindate] => [fbname] => [logintype] => [fbaccesstoken] => [newrepcount] => [vbseo_likes_in] => [vbseo_likes_out] => [vbseo_likes_unread] => [temp] => [field1] => [field2] => [field3] => [field4] => [field5] => [subfolders] => [pmfolders] => [buddylist] => [ignorelist] => [signature] => [searchprefs] => [rank] => [icontitle] => [iconpath] => [avatarpath] => [hascustomavatar] => 0 [avatardateline] => [avwidth] => [avheight] => [edit_userid] => [edit_username] => [edit_dateline] => [edit_reason] => [hashistory] => [pagetext_html] => [hasimages] => [signatureparsed] => [sighasimages] => [sigpic] => [sigpicdateline] => [sigpicwidth] => [sigpicheight] => [postcount] => 1 [islastshown] => [isfirstshown] => 1 [attachments] => [allattachments] => ) --> Application.cfm and cflock - Coldfusion - Advanced Techniques

Application.cfm and cflock - Coldfusion - Advanced Techniques

I am building a test app that lets you post news to a site in english and in french. So in the application.cfm file (in the root of the site -- not the wwwroot application.cfm file) contains the attached code. This app used to work on a nother machine on which it was created. The problem is now, when I brought it to this current development machine (running MX7), i get this error: Element PAGETITLES is undefined in a Java object of type class [Ljava.lang.String; referenced as The error occurred in C:\CFusionMX7\wwwroot\news_site\index.cfm: line 5 3 : </cfif> 4 : 5 ...

  1. #1

    Default Application.cfm and cflock

    I am building a test app that lets you post news to a site in english and in
    french.

    So in the application.cfm file (in the root of the site -- not the wwwroot
    application.cfm file) contains the attached code.

    This app used to work on a nother machine on which it was created.

    The problem is now, when I brought it to this current development machine
    (running MX7), i get this error:

    Element PAGETITLES is undefined in a Java object of type class
    [Ljava.lang.String; referenced as

    The error occurred in C:\CFusionMX7\wwwroot\news_site\index.cfm: line 5

    3 : </cfif>
    4 :
    5 : <cfset Request.title = Application.pageTitles[url.page & "_" &
    Request.lang & "_title"]>
    6 : <cfset Request.headertitle = Application.pageTitles[url.page & "_" &
    Request.lang & "_header_title"]>
    7 :

    The strange thing is, and I have no idea what I did before, but I had an
    install on this current machine of MX (6.1) last week and it also did not work.
    For some reason, after clicking around for a while, it worked. I have no idea
    what changed. Now that I have a fresh install of MX 7, it again does not work.,
    and I also cannot see any parts of the pages at all.

    I must be overlooking something small.

    Can anyone help with this?

    Thank you in advance,
    jer

    <cfApplication name="news_site" Sessionmanagement="yes" setclientcookies="yes">

    <cflock type="readonly" scope="Application" timeout="30">
    <cfset Request.Application = duplicate(Application) />
    </cflock>

    <cflock type="readonly" scope="Session" timeout="30">
    <cfset Request.Session = duplicate(Session) />
    </cflock>

    <cfif NOT isdefined("Request.Application.dbname")>
    <cfset Request.Application.dbname = 'news_site'>
    </cfif>

    <cfif NOT isdefined("Request.Session.lang")>
    <cfset Request.Session.lang = 'en'>
    </cfif>

    <cfif isdefined("url.lang")>
    <cfif url.lang EQ 'fr'>
    <cfset Request.Session.lang = 'fr'>
    <cfelse>
    <cfset Request.Session.lang = 'en'>
    </cfif>
    </cfif>

    <cfset Request.lang = Request.Session.lang>

    <cfset request.script = right(cgi.SCRIPT_NAME, len(cgi.SCRIPT_NAME)-11)>

    <cfif NOT isdefined("Request.Application.pageTitles") OR
    isdefined("Request.resetApp")>

    <!--- <cfif NOT isdefined("Application.pageTitles")> --->


    <cfset pageTitles = StructNew()>

    <!--- Index Page variables --->
    <cfset a = StructInsert(pageTitles, "index_en_header_title", "Welcome. Please
    read on.", 0)>
    <cfset a = StructInsert(pageTitles, "index_en_title", "News Stories", 0)>
    <cfset a = StructInsert(pageTitles, "index_fr_header_title", "Bienvenue.
    Lisez SVP.", 0)>
    <cfset a = StructInsert(pageTitles, "index_fr_title", "Mises &agrave; jour",
    0)>

    <!--- Login page variables --->
    <cfset a = StructInsert(pageTitles, "login_en_header_title", "Who are you.",
    0)>
    <cfset a = StructInsert(pageTitles, "login_en_title", "Please login", 0)>
    <cfset a = StructInsert(pageTitles, "login_fr_header_title", "Qui est-ce?",
    0)>
    <cfset a = StructInsert(pageTitles, "login_fr_title", "Ouvrir une Session",
    0)>


    <!--- addnews page variables --->
    <cfset a = StructInsert(pageTitles, "addnews_en_header_title", "Welcome.", 0)>
    <cfset a = StructInsert(pageTitles, "addnews_en_title", "Please add a news
    item", 0)>
    <cfset a = StructInsert(pageTitles, "addnews_fr_header_title", "Bienvenue.",
    0)>
    <cfset a = StructInsert(pageTitles, "addnews_fr_title", "Ajoutez un doent
    SVP", 0)>

    <cfset Request.Application.pageTitles = pageTitles>

    </cfif>

    jgillies Guest

  2. #2

    Default Re: Application.cfm and cflock

    In index.cfm, you are using Application.pageTitles.

    From the way you've structured things, it looks like you should be using Request.Application.pageTitles.

    Regards,
    -- MikeR
    MikerRoo Guest

  3. #3

    Default Re: Application.cfm and cflock

    Originally posted by: MikerRoo
    In index.cfm, you are using Application.pageTitles.

    From the way you've structured things, it looks like you should be using
    Request.Application.pageTitles.

    Regards,
    -- MikeR

    Magic!

    That was it!

    I wonder if it worked before because the variables were already set when we
    made the changes to the scope of the variables.

    Thank you for you assistance!
    jer



    jgillies Guest

Similar Threads

  1. CFlock
    By theDude28 in forum Macromedia ColdFusion
    Replies: 7
    Last Post: September 14th, 12:29 PM
  2. cflock
    By Kiriran in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: September 1st, 11:01 AM
  3. <cflock> help
    By BSterner in forum Coldfusion - Advanced Techniques
    Replies: 2
    Last Post: July 20th, 04:24 PM
  4. CFLOCK ?? Where and Why I must use it?
    By Red-Hand in forum Dreamweaver AppDev
    Replies: 2
    Last Post: May 20th, 05:57 AM
  5. application variables, cflock, and best-practise
    By ben_lclc in forum Coldfusion - Advanced Techniques
    Replies: 0
    Last Post: May 9th, 10:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •