Results 1 to 2 of 2
  1. #1
    bbq
    bbq is offline Senior Member
    Join Date
    Jun 2007
    Posts
    132
    Rep Power
    0

    Default Help with static variables

    I'm developing a web application using Tomcat 4.1 on windows XP.

    On login I calculate the path of my application using
    application.getRealPath(request.getContextPath())

    and store this value in a static variable of a class.

    Now I want to know whether this value will be set throughout the session

    thanks
    bbq

  2. #2
    Revelation is offline Member
    Join Date
    Jun 2007
    Posts
    6
    Rep Power
    0

    Default

    why is it that everything you ask sounds like its coming from text book questions?

    And I would say that value will remain throughout the session unless it loses scope. So if it has global scope to the class its gonna stay resident. If it has functional scope, its only going to be resident during the execution of that function.

Similar Threads

  1. accessing instance variables from static methods
    By ravian in forum New To Java
    Replies: 7
    Last Post: 03-01-2009, 11:09 PM
  2. Using Static Variables
    By Java Tip in forum java.lang
    Replies: 0
    Last Post: 04-17-2008, 12:08 AM
  3. Local Variables for a static method - thread safe?
    By mikeg1z in forum Advanced Java
    Replies: 1
    Last Post: 11-16-2007, 02:06 AM
  4. significance of static variables and methods
    By imran_khan in forum New To Java
    Replies: 4
    Last Post: 08-02-2007, 10:52 AM
  5. Replies: 1
    Last Post: 08-01-2007, 10:25 PM

Posting Permissions

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