DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7868>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=7868

[PATCH] protected createCocoon() in CocoonServlet





------- Additional Comments From [EMAIL PROTECTED]  2002-04-15 12:44 -------
The Context object is like a Map (in fact the underlying implementation is just
that: a Map).  As long as the components have a reference to the *same* context
object, the values will automatically be updated.  Try this to veryfy:

class Main
{
    public static void main(String[] args)
    {
        HashMap myMap = new HashMap();

        Test test1 = new Test(myMap);

        myMap.put ("key", "value");

        Test test2 = new Test(myMap);

        myMap.put ("test2", "value2");

        System.out.println("Outputing Test1");
        test1.dump();

        System.out.println();
        System.out.println("Outputing Test2");
        test2.dump();
    }
}

class Test
{
     HashMap theMap;

     public Test(HashMap map)
     {
         theMap = map;
     }

     public void dump()
     {
         Iterator i = theMap.keySet.iterator();
         while (i.hasNext())
         {
             Object key = i.next();
             System.out.println( key + " = " theMap.get( key );
         }
     }
}


When executed you should get the same results for both Test1 and Test2
(BTW, you may have to adjust my typing a little--I programmed from memory).

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]

Reply via email to