Jun
02
2016

Web Programming Pertemuan 10

JSP Standard Tag Library

  • JSTL
    • JSP Standard Tag Library(JSTL) menyediakan tags untuk common tasks yang dipakai di JSP
    • Mengurangi scripting
    • Membutuhkan JSTL Library
  • Untuk menggunakanJSTL Code Library, kita membutuhkan
    • Taglib yang mengarah ke JSTL Core Library
    • Untuk menggunakan library, anda harus memakai <taglib> diatas setiap JSP yang memakai library tersebut
    • Contoh : <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %>
  • JSTL tag bisa di klasifikasi berdasarkan fungsinya
    • Core Tags
      • Tags yang paling sering dipakai di JSTL Tags
      • Syntax untuk memakai JSTL Core Library adalah
        <%@ taglib prefix=”c” uri=”http://java.sun.com/jsp/jstl/core” %>
      • Untitled
      • Picture1
      • JSP Code dengan JSTL :<a href=”<c:url value=’/index.jsp‘ />”>Go to index</a>
      • Equivalent scripting :<a href=”<%=response.encodeURL(“index.jsp“)%>”> Go to index</a>
      • <c:out>
        • <c:out> tag memperlihatkan hasil dari sebuah ekspresi, mirip dengan tag <%=%>
      • <c:if>
        • evaluasi sebuah ekspresi dan memperlihatkan isi body jika ekspresinya bernilai True
      • <c:choose>
        •  Picture4 Picture3
      • <c:foreach>
        • Picture4 Picture5
      • <c:fortokens>
        • Picture6 Picture7
Written by gotomarch in: Uncategorized |

No Comments »

RSS feed for comments on this post. TrackBack URL


Leave a Reply

Powered by WordPress. Theme: TheBuckmaker. Zinsen, Streaming Audio