This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Servlets and the fly likes Is it necessary to remove any Request attributes? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Is it necessary to remove any Request attributes?" Watch "Is it necessary to remove any Request attributes?" New topic
Author

Is it necessary to remove any Request attributes?

Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Would it make noticeable slowdown in my application if I don't remove it? Would it add extra overhead to my app? Or is it destroyed sometime in my application? Thanks!


SCJP 1.5
http://devpinoy.org/blogs/lamia/ - http://everypesocounts.com/
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 63232
    
  69

Generally, don't worry about it. The request will go out of scope when the response is sent back to the client. At that time, any scoped variables (attributes) will be subject to garbage collection rules.

Because session and application scopes stay around longer, you need to be mindful of variable life-time in those scopes, but for page and request scopes, it's not usually an issue.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
dema rogatkin
Ranch Hand

Joined: Oct 09, 2002
Posts: 294
Some servlet containers maintain an object pool of request objects, so the content won't be collected. However in this case servlet container has to assure that request looks like freshly created.


Tough in space?, <a href="http://tjws.sf.net" target="_blank" rel="nofollow">Get J2EE servlet container under 150Kbytes here</a><br />Love your iPod and want it anywhere?<a href="http://mediachest.sf.net" target="_blank" rel="nofollow">Check it here.</a><br /><a href="http://7bee.j2ee.us/book/Generics%20in%20JDK%201.5.html" target="_blank" rel="nofollow">Curious about generic in Java?</a><br /><a href="http://7bee.j2ee.us/bee/index-bee.html" target="_blank" rel="nofollow">Hate ant? Use bee.</a><br /><a href="http://7bee.j2ee.us/addressbook/" target="_blank" rel="nofollow">Need contacts anywhere?</a><br /><a href="http://searchdir.sourceforge.net/" target="_blank" rel="nofollow">How to promote your business with a search engine</a>
Timothy Sam
Ranch Hand

Joined: Sep 18, 2005
Posts: 751
Thanks for your inputs guys
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Is it necessary to remove any Request attributes?
 
It's not a secret anymore!