Enabling J2EE Memory Variables

Ask a Question related to Coldfusion - Advanced Techniques, Design and Development.

  1. #1

    Default Enabling J2EE Memory Variables

    My question relates to ColdFusion MX 7 running under Win 2003.
    If I have a hosted site where the ISP refuses to enable J2EE Memory Variables
    on the server, but I need to use J2EE memory variables, is there a way to
    invoke them just for my site, say via Application.cfm?

    I've not found any reference to this elsewhere.

    I'd be grateful for any info.

    Regards

    Old Tony

    Old Tony Guest

  2. Similar Questions and Discussions

    1. j2ee session variables
      hi, i have been trying to use session variables in my app. I have enabled the session variables in the cf admin, and in the application.cfc. ...
    2. J2EE and CF Memory Variables settings
      We have a CFMX 7 server at work which has been set up for application development and testing. It is intended to server multiple developers whose...
    3. J2EE environment variables
      Hi all, I need to know how to set the J2EE environment variables. I can see that the JAVA_HOME environment variable is set, but i also need the...
    4. J2EE Session Variables (a.k.a. whaaaaa?)
      Okay, I've got J2EE sessions enabled, and I've got some clean up code in onSessionEnd in an Application.cfc. The code runs fine on a timeout (BTW,...
    5. Enabling ssl on web?
      Server: Apache/1.3.26 (Unix) Debian GNU/Linux mod_ssl/2.8.9 OpenSSL/0.9.6g mod_perl/1.26 PHP/4.1.2 Hello, how do I start apache w/ ssl support?...
  3. #2

    Default Re: Enabling J2EE Memory Variables

    I believe the setting is server wide.

    You can set it programmatically from Application.cfm using the Admin API.

    BUT... To use the API, you need the admin or an RDS password.

    I've posted sample code, below.
    But it sounds like you need to correct your ISP.

    -- MikeR



    <CFSCRIPT>
    sInitVal = "";

    if (IsDefined ("FORM.sPassWord"))
    sInitVal = FORM.sPassWord;
    </CFSCRIPT>


    <CFOUTPUT>
    <form method="post">
    <p>
    Enter the admin or RDS password:
    <input type="password" name="sPassWord" value="#sInitVal#">
    </p>

    <input type="submit" value="Login and switch J2EE sessions.">
    </form>
    </CFOUTPUT>


    <CFSCRIPT>
    if (IsDefined ("FORM.sPassWord"))
    {
    //--- Login is always required. This example uses two lines of code.
    ///*
    adminObj = createObject("component","cfide.adminapi.administr ator");
    adminObj.login ("#sInitVal#"); //, rdsPasswordAllowed="true");
    //*/

    //--- Instantiate the runtime control object. ---
    RT_Obj = createObject("component","cfide.adminapi.runtime") ;

    bAreSessionsEnabled = RT_Obj.getScopeProperty ("enableJ2EESessions");

    WriteOutput ("<h4>J2EE Sessions = #bAreSessionsEnabled#</h4>");

    RT_Obj.setScopeProperty ("enableJ2EESessions", "no");


    bAreSessionsEnabled = RT_Obj.getScopeProperty ("enableJ2EESessions");

    WriteOutput ("<h4>J2EE Sessions = #bAreSessionsEnabled#</h4>");

    RT_Obj.setScopeProperty ("enableJ2EESessions", "yes");


    bAreSessionsEnabled = RT_Obj.getScopeProperty ("enableJ2EESessions");

    WriteOutput ("<h4>J2EE Sessions = #bAreSessionsEnabled#</h4>");
    }

    </CFSCRIPT>

    MikerRoo Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139