• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSP Queries

 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1> What kind of objects are stored in session and what kind of objects are not stored in session ?

2> I have the below snippet of code


 
Abimaran Kugathasan
Ranch Hand
Posts: 2066
Clojure IntelliJ IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it won't be incremented! Check your code please~!
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Abimaran,
whats the answer for Question 1 and whats your justification for Answer 2
Regards
Deepak
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you think the answer to (1) is? Please ShowSomeEffort.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Contrary to popular usage, objects are not stored in sessions. References to objects are stored in sessions. Using the right words prevents making conceptual errors.

IF the servlet container decides to serialize the session to disk, THEN a copy of the object will be serialized.

Bill
 
Deepak Lal
Ranch Hand
Posts: 561
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
William Brogden wrote:Contrary to popular usage, objects are not stored in sessions. References to objects are stored in sessions. Using the right words prevents making conceptual errors.

IF the servlet container decides to serialize the session to disk, THEN a copy of the object will be serialized.

Bill


Hi William,
Im unable to understand the answer 1,Could you explain with a example for Answer 1.Im confused.
 
albert thomsan
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Request,Response such kinds of objects are stored in the session. I think that object's references are not stored in the session. Because I have already used a session in my practicals.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64994
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
albert thomsan wrote:Request,Response such kinds of objects are stored in the session. I think that object's references are not stored in the session

Incorrect, incorrect and incorrect. Not a great average.

The request and response are not stored in the session, and, when scoped variables are "added" to a session, object references to the objects are stored.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic