• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletRequest Attribute serialization  RSS feed

 
Nishant Vartak
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Is it necessary for attributes in ServletRequest\ServletResponse to be always serializable?I need to populate OutputStream in request\response.

Regards,
Nishant V
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, they don't need to be serializable.

Request and response objects (as their name suggests) only last one request/response cycle so they never need to be stored.

Session attributes, on the other hand, should be serializable.
In a clustered server situation serialization is needed for session replication.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!