On May 5, 2011, at 2:44 PM, sipungora wrote:
> I've done this, as you've explained me here. But I have one problem yet. If
> I save data in jar object from 1-st war for the 2-nd war, the 2-nd war
> cannot acces they. My object is the singleton.
>
> 1 protected static Controller controller;
> 2
> 3 public static Controller getInstance() {
> 4 if(controller == null) {
> 5 controller = new Controller();
> 6 }
> 7 return controller;
> 8 }
>
> If I debug 1-st war and then 2-nd one, I see that 2-nd war also goes into
> row 5. So both wars works with different objects.
> Can you explain me how can I solve this?
I don't think you can do this. I think each war is in its own class loader;
effectively each web application is in its own space. There may be ways to
configure your app server to share information between wars, but frankly the
whole concept smells of bad design.
--
Rick Genter
[email protected]
*******************************************************************************
This e-mail and any of its attachments may contain Interactions Corporation
proprietary information, which is privileged, confidential, or subject to
copyright belonging to the Interactions Corporation. This e-mail is intended
solely for the use of the individual or entity to which it is addressed. If you
are not the intended recipient of this e-mail, you are hereby notified that any
dissemination, distribution, copying, or action taken in relation to the
contents of and attachments to this e-mail is strictly prohibited and may be
unlawful. If you have received this e-mail in error, please notify the sender
immediately and permanently delete the original and any copy of this e-mail and
any printout. Thank You.
*******************************************************************************
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]