This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes session attribute Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "session attribute " Watch "session attribute " New topic
Author

session attribute

James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
a)A session attribute can only be a data type that implements the serializable interface
b)A container may throw an IllegalArgumentException in the setAttribute()
method of HttpSession if the attribute is not Serializable.

which statement is true?Please help.Thanks in Advance


SCJP1.4(96%) SCWCD1.4(92%)
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Could you please tell where you got those questions from ? And what do you think about it ?


[My Blog]
All roads lead to JavaRanch
James Mark
Ranch Hand

Joined: Jul 05, 2007
Posts: 115
statement a is from MarcusGreen Summary Quiz 2
statment b is from Manning Book
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Thank you for quoting your source. I don't think that objects must be Serializable, but it must be a consideration if you are using a distributed environment, where sessions may be migrated. So neither a nor be are correct.
 
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: session attribute
 
jQuery in Action, 3rd edition