JBOSS 点滴

丰丰的博客

struct2.0语法

字符串条件判断:
   <s:if   test="%{#listD.genreId == '402881b73e11d5f5013e11dc118f000a'}">
数字型判断:
   <s:iterator value="list" id="listD" status="ind1">
   <s:if test="#ind1.getIndex()<=6"   >
对象的取值方法:
        <s:iterator value="page" id="list" status="ind1">
      <s:iterator value="list" id="listD" status="ind1">
        <s:if test="#ind1.getIndex()<=5"   >
         <li> <a href="#"><span
           class="news">${listD.titleName}</span> </a> <span class="right"><s:date
            name="issueDate" format="yyyy-MM-dd" /> </span>
       </s:if>
      </s:iterator>
     </s:iterator>
在一个页面重复取list对象(不要id,,var,status):
        <s:iterator value="#list">
      <s:if test="%{genreId == '402881b73e11d5f5013e11dd21ea000c'}">
       <li><a href="../opt/PortalInfoDAction_queryContent.do?detailId=${detailId}"><span class="news">${titleName}</span> </a>
        <span class="right"><s:date name="issueDate"
          format="yyyy-MM-dd" /> </span>
      </s:if>
     </s:iterator>
sql条件的取值方法:
<s:iterator value="#a19list" var="a19list" status="ind1">
           <s:if test="#ind1.getIndex()<4">
           <li>
            <a
             href="<c:url value="/web/WebHomeAction_content.do?detailId=${detailId}"/>">${titleName}</a>
           </li>
          </s:if>
         </s:iterator>

判断大小: <s:property value="sysRegisterList.size()"/>

下拉框获取值:            
<select id="radioName" name="radioName"    >
    <c:forEach var="sysobject" items="${session.sysobject }" >
      <option name="" value="${sysobject.englishNames}" typeCode="${sysobject.dictName}" >${sysobject.chnName}</option>
   </c:forEach>
   </select> 
session取值:
JAVA中:ActionContext.getContext().getSession().put("sum2", (String)sumObject[1]);
取值:${session.sum2}

在struts中用#来访问ActionContext中的对象。

posted on 2013-05-14 17:15 半导体 阅读(178) 评论(0)  编辑  收藏 所属分类: Struct


只有注册用户登录后才能发表评论。


网站导航: