比如说我想输出一个el的变量<c:out value="${requestScope.user}" />但是我直接${requestScope.user}不是一样可以输出的吗?为何还要在外面套个<c:out标签呢?

解决方案 »

  1.   

    1)${requestScope.user} 是旧的写法
    2)<c:out标签 更安全
      

  2.   

    <c:out value="${requestScope.user}" />
    不仅仅是输出,还可以重用。
      

  3.   

    JSTL标准化语言是可以方便实现代码标签化,这样可视化的编辑器就好操作,更加好规范。
      

  4.   

    JSTL in Action里面3.1.2说:In JSTL 1.0, expressions have special meaning only inside  JSTL tag attributes. Spe-
    cifically, they don't work in template text. You can't simply write
    <p>Hi ${username}</p>
    in your  page and expect the result to be dynamic.现在jstl1.1了.
    是不是为了历史兼容?