Struts2 and Jstl the notation of the loops

Source: Internet
Author: User

A: Preface

Actually feel oneself now is a yard, ah, for STRUTS2 label and Jstl label I always will only use, but feel oneself always will confuse this conceptual question. So I myself in the code to try to use a few ways to achieve the same effect, the following gives the corresponding JSP code, only the label part

II: Content

    

//------------------JSTL C Tag--------//introduction of C and FMT tags<%@ taglib Prefix="C"URI="Http://java.sun.com/jsp/jstl/core" %><%@ taglib prefix= "FMT" uri= "Http://java.sun.com/jsp/jstl/fmt"%><C:foreachItems= "${list}"var= "PS">   <c:ifTest= "${ps.mk== ' Personnel information '}">    <TR>        <TDAlign= "Center">${PS.BH}</TD>        <TDAlign= "Center">${PS.XM}</TD>        <TDAlign= "Center">${PS.XB}</TD>        <TDAlign= "Center">${PS.ZT}</TD>       <TDAlign= "Center"><fmt:formatdatevalue= "${PS.SJ}"pattern= "Yyyy-mm-dd">    </TR>   </c:if></C:foreach>

Pure Struts2 Label:

//Introduction of STRUTS2 tags<%@ taglib Prefix="s"URI="/struts-tags"%><S:iteratorvalue= "#request. List"var= "FR">        <s:ifTest= "#fr. mk== ' WH '">    <TR>            <TDAlign= "Center"><S:propertyvalue= "#fr. Zfbh"/></TD>            <TDAlign= "Center"><S:propertyvalue= "#fr. XM"/></TD>            <TDAlign= "Center"><S:propertyvalue= "#fr. Szjq"/></TD>            <TDAlign= "Center"><S:propertyvalue= "#fr. ZT"/></TD>    </TR>        </s:if></S:iterator>

Struts2 and Jstl binding body

<%@ taglib Prefix="s"URI="/struts-tags"%><%@ taglib Prefix="C"URI="Http://java.sun.com/jsp/jstl/core" %>    <S:iteratorvalue= "#request. List"var= "FR">        <c:ifTest= "${fr.mk== ' personnel information '}">        <TR>            <TDAlign= "Center">${FR.ZFBH}</TD>            <TDAlign= "Center">${FR.XM}</TD>            <TDAlign= "Center">123</TD>            <TDAlign= "Center">${FR.ZT}</TD>        </TR>        </c:if>    </S:iterator>

Three: summary

As long as you do not confuse the use of the above method is good. I went through the experiment, the impression is more profound. Recently very impetuous Ah, now is want to resign, want to leave, I do not graduate now, but only to 4k one months, there is no five risks a gold what, not to mention what welfare, so is completely pull the egg, mister also and I said I am impetuous, I want to calm down the heart, forget, no need, go. Sooner or later, you have to leave. Here do not leave ye, the freedom to leave the ye place ah. Study hard, day after day.

Struts2 and Jstl the notation of the loops

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.