比如定义一个String a = “hello”;我想在JSP页面传这句话“<c:if test="〈% ${username} == ${a} %〉"></c:if>”
到另一个JSP页面 ${a}要按值输出 其他按原形输出怎么做输呢?最后出来的东西就是”<c:if test="${username== “hello“}"></c:if>“饶不过来了 汗 帮我看看怎么打这句话 谢谢大牛们

解决方案 »

  1.   

    <c:if test="${username} == ${a}"></c:if>
    用EL的时候,不需要<%...%>
      

  2.   

    大哥   <c:if test="${username} == ${a}"></c:if>${username}这样的话不是原形输出了
      

  3.   

    不行啊 我需要的是${username}要原样输出  得到的结果是"<c:if test="${username== "hello"}"></c:if>"
      

  4.   

    <c:if test="\${username} == ${a}"></c:if>
    如果希望${username}里面的$是普通字符,则需要用\转义