• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Bind class to HttpSession?

 
Pradeep Shankar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am designing a simple web app which looks up payments.

The application will be deployed into a redundant environment.

How can the following class be designed to be bound to an HttpSession?



The front end will be something like this:



Thank you very much.
 
Campbell Ritchie
Sheriff
Pie
Posts: 50171
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the Ranch

I think that question is too difficult for "beginning", so I shall move it.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13073
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want an object reference to be stored in a HttpSession reliably, you must make the class Serializable.

The reason being that the servlet container is allowed to serialize the session to disk any time it wants to. If all the bound objects are not serializable you will get an error.

Bill

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic