各位大大 我线承认自己是菜鸟
下面说正事
我在一个Action里面 arg2.setAttribute("errorinfo",p);
我想在JSP里面判断 errorinfo 是否存在
是用 present 标签吗
里面有急个属性 cookie header pramater name property scope role user
我试了都不行
不知道用什么了
谁给解释下
谢谢

解决方案 »

  1.   

    就是 setattribute 里面设置的 内容对应 哪个个cookie header pramater name property scope role user 
      

  2.   

    我也菜哈哈 给你个办法
    在jsp中<%String info=request.getAttribute("errorinfo")%>
    然后判断info是否为空应该就行。
      

  3.   

    这个我知道的
    但是我们现在在学strucs 
    所以想用标签实现
      

  4.   

    在jsp页面${requestScope.errorinfo}试试
    不过你要支持EL表达式
      

  5.   


        <bean:present name="errorinfo">
             <bean:write name="errorinfo"/>
        </bean:present>一般都这样写的...
      

  6.   

    JSTL<c:choose>
    <c:when test="${not empty requestScope.errorinfo}">
    存在
    </c:when>
    <c:otherwise>不存在</c:otherwise>
    </c:choose>如果你要用struts自带的标签库也行,肯定有相应的,不管是1还是2
      

  7.   

    要什么标签,直接简单的判断下就可以了!if(request.getAttribute("errorinfo")!=null){
       errorinfo = request.getAttribute("errorinfo");//说明存在,进行赋值
    }else{
       errorinfo = null;//不存在,置空
    }
      

  8.   

    <c:if test="${empty errorinfo}" >
    no data
    </c:if><c:if test="${not empty errorinfo}">
    <c:foreach items="${errorinfo}" var="err">
    ${err.name}
    ...
    </c:foreach>
    </c:if>