书上说:
a jsp:useBean element results in a new bean being instantiated only if no bean with the same id and scope can be found. If a bean with the id and scope is found, the preexisting bean is simply bound to the variable referenced by id.但实际上,我通过程序的测试发现,<jsp:useBean .... />根本就是执行了create,而不是bound啊能解释一下吗?

解决方案 »

  1.   

    <tag>...</tag>是标准的标签配对方式,不过如果标签是单边的就要用<tag.../>方式
      

  2.   

    但是这段话如何理解呢?
    a jsp:useBean element results in a new bean being instantiated only if no bean with the same id and scope can be found. If a bean with the id and scope is found, the preexisting bean is simply bound to the variable referenced by id.from: Java Servlet Programming(Jason Hunter)
      

  3.   

    有那么一点点区别,如果你要给这个javaBean设置参数,你就必须用
    <jsp:useBean> 
      <jsp:setProperty></jsp:setProperty>
    </jsp:useBean>这种写法
      

  4.   

    《core Servlet and Java》
    “the statement between (<jsp:useBean> .... </jsp:useBean>) executed only if a new bean is created, not if an existing bean is used. "这个应该是比较正确的说法
      

  5.   

    在CREATE时<jsp:useBean> .... </jsp:useBean>似乎比<jsp:useBean .... />好用,BOUND么正相反