Meaningless Drivel is fun!*
The moose likes JSP and the fly likes passing a session object to a bean problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "passing a session object to a bean problem" Watch "passing a session object to a bean problem" New topic
Author

passing a session object to a bean problem

Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
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
 
subject: passing a session object to a bean problem
 
Similar Threads
Strange Spring problem
Value bean or backing bean?
using servlet-applet communication and sharing information with oter jsp pages
Architecture of presentation and business layer
Help With HttpUrlConnection class