0

I am storing all the instances of a taglib from its doStartTag() method into an arraylist in following manner:

    repeatTag.setTD(this);

And in the setTD() method have the following code for adding the instance to arrayList.

    public List<TDTag> tdlist;
    public List<TDTag> getTDList(){
       return tdlist;
    }
    public void setTD(TDTag tdTag){
       tdlist.add(tdTag);
    }

Here all the elements in tdlist is having the last instance of TDTag. The above code is working fine in weblogic and websphere. Issue only in JBOSS. Why is the behavior in JBOSS, different from weblogic? Where could I have been doing mistake?

Aleksandr M
  • 24,264
  • 12
  • 69
  • 143
  • This is not a duplicate but is very much similar – Amit Kumar Pandit Jun 28 '17 at 11:13
  • Finally found the issue, in JBOSS 7, tag pooling is enabled by default and same instance of `TDTag` was added into arraylist with new values. Hence all elements point to the same object with the values of last execution of TDTag. – Amit Kumar Pandit Jun 28 '17 at 16:17

0 Answers0