Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

passing a session object to a bean problem

 
Dave Vick
Ranch Hand
Posts: 3244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey everyone
I have a set a jsp pages and beans that need to interact with an xml Document object. I have a controller servlet that parses the xml file and saves the document object to the session. Then my jsp pages get the Document object fromt he session and pass it to the appropriate beans to work with.
The problem is that one of my beans hanges the document (it changes the value of a Text node) but when I print the document later in the app it is unchanged.
I guess my question is if variables passes from mthe jsp to a bean or from the session to a jsp are passed by value (ie i'm dealing with a copy instead of the original)?
any input would be appreciated,
thanks
 
Dave Vick
Ranch Hand
Posts: 3244
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nevermind, I figured it out.
They are all passed by reference (well,by value which is really a reference). There was nothing wrong with the doc object or the session of the context. I was just being stupid and trying to use the doc object before I had set the bean property,
Duhhh!!!
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic