• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

passing a session object to a bean problem

 
Ranch Hand
Posts: 3244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!!!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic