自己写了一个自定义标签的处理类testTag
public class testTag extends TagSupport
{
private String test1="test1";
private String test2="test2";
private String common="common";

public int doEndTag() throws JspException
{
System.out.println(test1);
System.out.println(test2);

common+=test1+test2;
System.out.println(common);
System.out.println("-------");
return super.doEndTag();
}
      .......
}
在同一jsp页面中使用两个该标签,发现这两个表签在共用一个对象,如下
<xx:test test1="a1" test2="a2" />
<xx:test test1="b1" test2="b2"/>结果如下:
a1
a2
commona1a2
-------
b1
b2
commona1a2b1b2本以为第二个test标签的common应该=commonb1b2,但是运行结果发现在第二个test标签中的common变量是在第一个test标签的common值“commona1a2”的基础上加"b1b2"得到,也就是说两个标签在共用一个标签处理类对象。有没办法使每个test标签保持它自己的状态??????