aspose file tools
The moose likes Servlets and the fly likes Any Other Techniques other than httpSession Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Any Other Techniques other than httpSession" Watch "Any Other Techniques other than httpSession" New topic
Author

Any Other Techniques other than httpSession

Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 78
Hi,
I've been using HTTPSession objects in my applications to carry data. I would like to know if there is another technology by which we could handle this functionality. if yes, is it more efficient than using sessions?
Thanks in advance... javascript:emoticon('');
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56168
    
  13

Without knowing anything about your data or how it is being used, it's impossible to say anything.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 78
Hi,
Thanks for the reply.
IO don't have any data and i am not facing any situation. it is just for knowledge sake.
i just want to know if there is any way data(variables, objects, or anything that a HTTPSession can hold) can be held for use in any of the pages.
also, is the HTTPSession objects stored in the main memory?

Thanks a lot...!
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56168
    
  13

There are four scopes: page (for JSPs), request, session and application. Which to use depends upon the situation so without any specifics, impossible to answer.
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6588
    
    1

Bear Bibeault wrote:There are four scopes: page (for JSPs), request, session and application. Which to use depends upon the situation so without any specifics, impossible to answer.


You can use the 4 scopes that Bear mentioned. You do not have any specific requirement ?


SCJP 6 articles - SCJP 5/6 mock exams - SCJP Mocks - SCJP 5 Mock exam (Word document ) - SCJP 5 Mock exam in Java.Inquisition format
Nitin Menon
Ranch Hand

Joined: Jun 13, 2007
Posts: 78
no.
Actually, one of my friends who is just into Java had asked me this doubt.
Even, i know very little.
Thanks for the information.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12266
    
    1
is the HTTPSession objects stored in the main memory?


Servlet containers have the option of serializing a session and storing it anywhere they want. Thats why ALL objects having a reference saved in a session should implement Serializable to avoid mysterious failures. Thats also why you should not save references to objects managed by other processes, such as DB connection pools, in sessions.

Bill


Java Resources at www.wbrogden.com
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

William Brogden wrote:Thats why ALL objects having a reference saved in a session should implement Serializable to avoid mysterious failures.


well William, is it mandatory ?
 
I agree. Here's the link: http://jrebel.com/download
 
subject: Any Other Techniques other than httpSession
 
Similar Threads
Adding a parameter to a request
method getAttribute throws exception
is session different for same user
Diff between HttpSession and Stateful Session bean
PortletSession and duplicate portlets