把context设计成一个单实例的就ok了
if(context ==null)
{
    context  = new ClassPathXmlApplicationContext("dataAccessContext.xml");}
else
{
    return context  ;
}

解决方案 »

  1.   

    private final ApplicationContext context = null;
    public ApplicationContext  getContext();
      

  2.   

    谢谢2位~ 标签的部分代码,不知道如何修改再指点下吧!
    public int doEndTag() throws JspTagException {

    Logger logger = Logger.getLogger(SelectClient.class.getName());

    try {
    ApplicationContext context = new ClassPathXmlApplicationContext("dataAccessContext.xml");
    ClientDao clientDao = (ClientDao)context.getBean("clientDao");
    List list = clientDao.getClient();
    Iterator it = list.iterator(); while(it.hasNext())
    {
                                  ...........
    } pageContext.getOut().write(selectStr);
    }catch(Exception ex) {
    logger.error("【自定义标签错误】" + ex);
    }

    return EVAL_PAGE;
    }
      

  3.   

    其中context 应用 import org.springframework.context.ApplicationContext;