Java Server Pages

Moderators: None (Apply to moderate this forum)
Number of threads: 306
Number of posts: 629

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
scope="application" and scope="session" Posted by hedis on 26 Mar 2003 at 9:30 AM

<jsp:useBean scope="application" id="myOwnBean" ...>

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


Report
Re: scope="application" and scope="session" Posted by treshr on 27 Mar 2003 at 12:46 AM
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][=--

Report
Re: scope="application" and scope="session" Posted by hedis on 27 Mar 2003 at 2:35 AM

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][=--


Report
Re: scope="application" and scope="session" Posted by treshr on 28 Mar 2003 at 2:51 AM
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][=--

Report
Re: scope="application" and scope="session" Posted by xstreamke on 15 Apr 2003 at 7:55 AM
: 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][=--
:
:

Report
Re: scope="application" and scope="session" Posted by xstreamke on 15 Apr 2003 at 7:56 AM
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][=--
:
:

Report
Re: scope="application" and scope="session" Posted by uwillal on 1 Jun 2009 at 8:06 AM
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.





 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.