This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
First, a bit of business: you may not have read our naming policy on the way in. It requires that you use a full, real (sounding) first and last name for your display name. Obviously fake names and "handles" aren't alowed here. You can change your display name here. Thanks!
Regarding the formatting in your posts; you can use the UBB "CODE" tag to preserve formatting of code or code-like text in your posts. Just wrap the code in tags that look like HTML <CODE> tags, but use square brackets "" instead of angle brackets "<>".
As to your actual question: based on what you've told Layne, it sounds like myZ is a local variable in a method. A local variable is accessible only inside the method where it's declared; you could turn myZ into a protected member of Servlet1.
Finally, we frown on posting duplicate threads -- please don't do it. I deleted the copies of this you posted in Servlets and in Advanced Java.
It looks like you didn't post a copy in the one forum where this question really belongs: Java in General (Beginner). I'll move this thread there for you. [ March 21, 2005: Message edited by: Ernest Friedman-Hill ]
Right, so that's as I guessed. myZ is a local variable in init(). It needs to be a member variable of Servlet1 -- i.e., defined, although not necessarily initialized, outside of any method -- for Servlet2 to see it.
Of course, depending on what's going on, exactly, this could be a bad idea, because of how Servlet objects are shared. Depending on the situation, it may be better to store the informating in the SessionContext, for example.
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: how to reference the class-instance, created in parent class.