jstl 태그steemCreated with Sketch.

in #kr6 years ago

간단하게 jstl 태그 2개만알아보겠습니다.

C:forEach

<c:forEach var =”I” items=”${members}” begin=”0” varStatus=”status” end =”5”>
    Index : ${status.index} /
    count : ${status.count} <br>
    name : ${i.name} <br>
    email : ${i.email}<br>
</c:forEach>

forEach 문은 Var, items, begin, varStatus, end.. 총 5개의 속성들이 있습니다.

i라는 변수는 반복문이 한번 수행 될때마다 바뀌는변수가 되겠다.

그리고 items 라는 속성은 컬렉션 객체가 된다.

예를 간단히 들자면 리스트, 배열정도가 있겠다.

그리고 begin 은 시작값을 나타냅니다.

varStatus 은 반복문의 상태값을 가지는 변수인데 쉽게말해

forEach문의 상태정보를 담고있는 변수라고 알고있으면 되겠다,


C:forTokens
<c:forTokens>
<c:forTokens items = “123-456-789” delims =”-” var =”sel”>
   ${sel}<br>
</c:forTokens>

여기서 items 은 123-456-789라고했는데 일종의 소스이다

그리고 중요한건 delims 라는 건데 얘는 일종의 약속이다.

여기선 – 이 등장할때마다 띄어쓰기를 해달라고 요청을 했다.
그결과는 sel 라는 변수로 지정했다.


Sort:  

Congratulations @a991102! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes received

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click here

If you no longer want to receive notifications, reply to this comment with the word STOP

Upvote this notification to help all Steemit users. Learn why here!

JSTL 이라는 것도 있군요^^

편리합니다 ㅎㅎ
잘은사용못하지만..

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.030
BTC 62267.87
ETH 3427.43
USDT 1.00
SBD 2.48