2 Replies Latest reply on Oct 12, 2007 4:47 AM by harpritt

    Application Context availability

    harpritt

      Hiya gents and ladies.... (i wish there were more female programmers)

      My Seam app is coming along really really well... im extreamly chuffed with it.... i actually feel a bit guilty for having had so much fun using SEAM.....

      anyway, im writting a servet that gets initialized durring application start to act as a global notifier of resource availability.

      what i want it to do is simply check a resource e.g. my cvs server and it to add a parameter to the application context indicating its status.

      i can then check the application context from anywhere in my app for resource status.

      im having a shed load of trouble trying to get a hold of the Application context

      public void init(ServletConfig config) throws ServletException {
      
      // Add parameter to Application context ... ARGGHHH!
      
      }



      .. ive got myself very confused... to the point where i cant even remember what the difference between the application scope and context are... google aint helping....


      Anyway .... all help as allways is greatly apprieciated.

      H

        • 1. Re: Application Context availability
          shane.bryzak

           

          Lifecycle.mockApplication();
           try
           {
           // code that accesses application context goes here
           }
           finally
           {
           Lifecycle.unmockApplication();
           }


          • 2. Re: Application Context availability
            harpritt

            Dude

            Thank you very much indeed..... you are super!... Super Dan super!..without his chin!

            i can believe i was being so thick.....

            I was overriding the init(config) and not calling super.... soooooo getServeltContext was allways going to be null...

            ballllz

            Shane.... what does Lifecycle.mockApplication do?

            cheers again man