JSP question...


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: JSP question...

Hybrid View

  1. #1
    Jorge Quintero Guest

    JSP question...


    Hi guys,

    I have a question:


    What is the scope of a java class that is loaded inside a JSP page? My
    java class follows the Singleton pattern. If my JSP page is unloaded, is
    the Singleton destroyed by the JVM? what if I click "back" in my browser
    and return to the JSP page?


    Thanks in advance.

    Jorge Quintero.

  2. #2
    Paul Clapham Guest

    Re: JSP question...

    I don't know the anwer to the first question, but if you click "back" in the
    browser it will simply redisplay the HTML that it saved from the previous
    time it displayed the page. It will not go back to the server unless you
    click on "reload"... which brings you back to your first question.

    Jorge Quintero <dsw86@hotmail.com> wrote in message
    news:396b5c98$1@news.devx.com...
    >
    > Hi guys,
    >
    > I have a question:
    >
    >
    > What is the scope of a java class that is loaded inside a JSP page? My
    > java class follows the Singleton pattern. If my JSP page is unloaded, is
    > the Singleton destroyed by the JVM? what if I click "back" in my browser
    > and return to the JSP page?
    >
    >
    > Thanks in advance.
    >
    > Jorge Quintero.




  3. #3
    John Timney (MVP) Guest

    Re: JSP question...

    the scope is the same as if you loaded it in a java program rather than a
    jsp, if you dump the class into a session variable then it could have wider
    scope.

    if your page is unloaded and you click back you will get whats in your
    browser buffer until you reload the page, after all its just html or text in
    the page.

    Regards

    John Timney (MVP)


    Jorge Quintero <dsw86@hotmail.com> wrote in message
    news:396b5c98$1@news.devx.com...
    >
    > Hi guys,
    >
    > I have a question:
    >
    >
    > What is the scope of a java class that is loaded inside a JSP page? My
    > java class follows the Singleton pattern. If my JSP page is unloaded, is
    > the Singleton destroyed by the JVM? what if I click "back" in my browser
    > and return to the JSP page?
    >
    >
    > Thanks in advance.
    >
    > Jorge Quintero.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center