scope="application" and scope="session"




How do I stop/kill a instans of that bean in my JSP-code so the instans
disapear ?


Comments

  • You don't.
    You have a few scopes that you can use:
    Request
    Page
    Session
    Application

    If you have a request scope, it will only run for the request that is made on that same moment.
    If you have a page scope, the parameters and values will run for that page the whole time until the server is restarted.
    If you have a session scope, all the values will be kept for until the clients session is destroyed.
    And least the application scope, if you apply the application scope, the values will be kept for the entire application, until the server is restarted.

    Hope this cleared up a bit.
    Success,


    --=][tReShR][=--


  • Hi --=][tReShR][=--,

    I found the answer that:

    application.removeAttribute("myBeanName");
    _and_
    session.removeAttribute("myBeanName");

    Removes the instans of my bean...

    Couldnt this be true?...its work for me.

    // hedis

    You Wrote:
    : You don't.
    : ...
    : And least the application scope, if you apply the application scope, the values will be kept for the entire application, until the server is restarted.
    : --=][tReShR][=--


  • You probably can, but the thing is, it is not a really good way to do it.

    You have to be sure about the scope before you're using it, otherwise why would even use a scope if you can just reamove it this way.

    That's why I said to use different scopes that you can use in a good way.

    I even think that there are gonna problems later on, when you use this in a big application. Like bugs, or values from different JavaBeans.

    My advice is not to just remove the attributes and let Tomcat or Websphere take care of all the managing, that's their work.


    --=][tReShR][=--

  • : You probably can, but the thing is, it is not a really good way to do it.
    :
    : You have to be sure about the scope before you're using it, otherwise why would even use a scope if you can just reamove it this way.
    :
    : That's why I said to use different scopes that you can use in a good way.
    :
    : I even think that there are gonna problems later on, when you use this in a big application. Like bugs, or values from different JavaBeans.
    :
    : My advice is not to just remove the attributes and let Tomcat or Websphere take care of all the managing, that's their work.
    :
    :
    : --=][tReShR][=--
    :
    :

  • Why don't you just invalidate your application or session cookies???
    example <%session.invalidate()%>
    : You probably can, but the thing is, it is not a really good way to do it.
    :
    : You have to be sure about the scope before you're using it, otherwise why would even use a scope if you can just reamove it this way.
    :
    : That's why I said to use different scopes that you can use in a good way.
    :
    : I even think that there are gonna problems later on, when you use this in a big application. Like bugs, or values from different JavaBeans.
    :
    : My advice is not to just remove the attributes and let Tomcat or Websphere take care of all the managing, that's their work.
    :
    :
    : --=][tReShR][=--
    :
    :

  • Wait a minute, you just defined everything in term of themselves ie - request scope lasts for the length of the request etc.

    Has anybody here ever take math?

    What actions on the part of a user or server start a request?
    What actions on the part of a user or server end a request?
    What actions on the part of a user or server start a page?
    What actions on the part of a user or server end a page?
    What actions on the part of a user or server start a session?
    What actions on the part of a user or server end a session?
    What actions on the part of a user or server start an application?
    What actions on the part of a user or server end an application?

    If you are unable to give a definition without using the term to be defined, you aren't giving a definition.


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories