Win a copy of Murach's Java Programming this week in the Beginning Java forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Bind class to HttpSession?  RSS feed

 
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
Marshal
Posts: 54866
155
  • 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: 13078
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

 
Oh. Hi guys! Look at this tiny ad:
Thoughts on deprecation in Java
https://coderanch.com/t/683016/java/Deprecation-Java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!