• Post Reply Bookmark Topic Watch Topic
  • New Topic

Does request.setAttribute makes a copy of the object  RSS feed

 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers,

When I say request.setAttribute will it make a copy of the object specified, or it just holds a reference of that object?

For ex: what will happen here?



Now will myParam has "Test" be available?

Ananth Chellathurai
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16057
88
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does not make a copy of the object that you set as the attribute value; it keeps a reference to the existing object.
 
Ananth Chellathurai
Ranch Hand
Posts: 349
Eclipse IDE Hibernate Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you Jesper for your reply.

Ananth Chellathurai
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!