JSTL standard tag library Example
index.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<HEAD>
<TITLE>WTAD: Ex31 : www.BipinRupadiya.com</TITLE>
</HEAD>
<BODY>
<h3>Example of JSTL standard tag library.</h3>
<ul>
<li><a href="set.jsp">set, remove and out</a></li>
<!-- Example of c:for -->
<li><a href="for.jsp">for</a></li>
<!-- Example of c:if -->
<li><a href="if.jsp">if</a></li>
<!-- Example of c:choose -->
<li><a href="choose.jsp">choose</a></li>
<!-- Example of c:redirect and c:param -->
<li><a href="redirect.jsp">redirect</a></li>
</ul>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE>WTAD: Ex31 : www.BipinRupadiya.com</TITLE>
</HEAD>
<BODY>
<h3>Example of JSTL standard tag library.</h3>
<ul>
<li><a href="set.jsp">set, remove and out</a></li>
<!-- Example of c:for -->
<li><a href="for.jsp">for</a></li>
<!-- Example of c:if -->
<li><a href="if.jsp">if</a></li>
<!-- Example of c:choose -->
<li><a href="choose.jsp">choose</a></li>
<!-- Example of c:redirect and c:param -->
<li><a href="redirect.jsp">redirect</a></li>
</ul>
</BODY>
</HTML>
set.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<HEAD>
<TITLE><c:out value="<c:set>, <c:remove> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">
<CODE><c:out value="<c:set>, <c:remove> Tags"/></CODE>
</H1>
<c:set var="map" value="<%= new java.util.HashMap() %>" scope="request"/>
<c:set target="${map}" property="partialTitle" value="<read-it>Core</read-it>"/>
<c:set target="${map}" property="fullTitle">
<c:out value="${map.partialTitle}"/> <BR> Servlets and JSP Volume 2 </c:set>
<H1 ALIGN="CENTER">${map.fullTitle}</H1>
<c:set var="authors" value="Marty Hall, Larry Brown, Yaakov Chaikin" scope="request"/>
<c:set var="authors">Authors</c:set>
<H2 ALIGN="CENTER">${authors}: ${requestScope.authors}</H2>
<c:remove var="authors"/>
<H2 ALIGN="CENTER">${pageScope.authors}: ${requestScope.authors}</H2>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE><c:out value="<c:set>, <c:remove> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="CENTER">
<CODE><c:out value="<c:set>, <c:remove> Tags"/></CODE>
</H1>
<c:set var="map" value="<%= new java.util.HashMap() %>" scope="request"/>
<c:set target="${map}" property="partialTitle" value="<read-it>Core</read-it>"/>
<c:set target="${map}" property="fullTitle">
<c:out value="${map.partialTitle}"/> <BR> Servlets and JSP Volume 2 </c:set>
<H1 ALIGN="CENTER">${map.fullTitle}</H1>
<c:set var="authors" value="Marty Hall, Larry Brown, Yaakov Chaikin" scope="request"/>
<c:set var="authors">Authors</c:set>
<H2 ALIGN="CENTER">${authors}: ${requestScope.authors}</H2>
<c:remove var="authors"/>
<H2 ALIGN="CENTER">${pageScope.authors}: ${requestScope.authors}</H2>
</BODY>
</HTML>
for.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<HEAD>
<TITLE><c:out value="<c:foreach>, <c:forTokens> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center">
<CODE><c:out value="<c:foreach>, <c:forTokens> Tags"/></CODE>
</H1>
<TABLE>
<TR>
<TD>
<UL>
<c:forEach var="i" begin="1" end="10" step="2">
<LI>i = ${i}</LI>
</c:forEach>
</UL>
</TD>
<TD>
<%
java.util.List list = new java.util.ArrayList();
list.add("One");
list.add("Two");
list.add("Three");
list.add("Four");
list.add("Five");
request.setAttribute("list", list);
%>
<UL>
<c:forEach var="item" items="${list}">
<LI>${item}</LI>
</c:forEach>
</UL>
</TD>
<TD>
<UL>
<!--forTokens sperat string by special symboles in delims atributes-->
<c:forTokens var="item" items="<Once)Upon,A(Time%There...>" delims="<),A(%>">
<LI>${item}</LI>
</c:forTokens>
</UL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE><c:out value="<c:foreach>, <c:forTokens> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center">
<CODE><c:out value="<c:foreach>, <c:forTokens> Tags"/></CODE>
</H1>
<TABLE>
<TR>
<TD>
<UL>
<c:forEach var="i" begin="1" end="10" step="2">
<LI>i = ${i}</LI>
</c:forEach>
</UL>
</TD>
<TD>
<%
java.util.List list = new java.util.ArrayList();
list.add("One");
list.add("Two");
list.add("Three");
list.add("Four");
list.add("Five");
request.setAttribute("list", list);
%>
<UL>
<c:forEach var="item" items="${list}">
<LI>${item}</LI>
</c:forEach>
</UL>
</TD>
<TD>
<UL>
<!--forTokens sperat string by special symboles in delims atributes-->
<c:forTokens var="item" items="<Once)Upon,A(Time%There...>" delims="<),A(%>">
<LI>${item}</LI>
</c:forTokens>
</UL>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
if.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<HEAD>
<TITLE><c:out value="<c:if> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center"><CODE><c:out value="<c:if> Tag"/></CODE></H1>
<UL>
<c:forEach var="i" begin="1" end="10" step="2">
<LI>
i = ${i}
<c:if test="${i > 3}">
(greater than 3)
</c:if>
</LI>
</c:forEach>
</UL>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE><c:out value="<c:if> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center"><CODE><c:out value="<c:if> Tag"/></CODE></H1>
<UL>
<c:forEach var="i" begin="1" end="10" step="2">
<LI>
i = ${i}
<c:if test="${i > 3}">
(greater than 3)
</c:if>
</LI>
</c:forEach>
</UL>
</BODY>
</HTML>
choose.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<HTML>
<HEAD>
<TITLE><c:out value="<c:choose>, <c:when>, <c:otherwise> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center">
<CODE><c:out value="<c:choose>, <c:when>, <c:otherwise> Tags"/></CODE>
</H1>
<UL>
<c:forEach var="i" begin="1" end="10">
<LI>i = ${i}
<c:choose>
<c:when test="${i < 3}">(less than 3)</c:when>
<c:when test="${i < 5}">(less than 5)</c:when>
<c:when test="${i == 5}">(It IS 5! SO exciting!)</c:when>
<c:otherwise>(greater than 5)</c:otherwise>
</c:choose>
</LI>
</c:forEach>
</UL>
</BODY>
</HTML>
<HTML>
<HEAD>
<TITLE><c:out value="<c:choose>, <c:when>, <c:otherwise> Tags"/></TITLE>
</HEAD>
<BODY>
<H1 ALIGN="center">
<CODE><c:out value="<c:choose>, <c:when>, <c:otherwise> Tags"/></CODE>
</H1>
<UL>
<c:forEach var="i" begin="1" end="10">
<LI>i = ${i}
<c:choose>
<c:when test="${i < 3}">(less than 3)</c:when>
<c:when test="${i < 5}">(less than 5)</c:when>
<c:when test="${i == 5}">(It IS 5! SO exciting!)</c:when>
<c:otherwise>(greater than 5)</c:otherwise>
</c:choose>
</LI>
</c:forEach>
</UL>
</BODY>
</HTML>
redirect.jsp
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:redirect url="http://www.google.com/search">
<c:param name="hl" value="en"/>
<c:param name="q">Bipin Rupadiya</c:param>
</c:redirect>
<c:redirect url="http://www.google.com/search">
<c:param name="hl" value="en"/>
<c:param name="q">Bipin Rupadiya</c:param>
</c:redirect>
Subscribe to:
Post Comments (Atom)
Subjects
- WordPress
- Mobile Computing-4649303 Practical Solution
- Android Programming New Syllabus Theory
- PHP LAMP Question Bank
- PHP LAMP Theory
- Step by Step Android Example
- Android Practical
- Android Theory
- Android Question Bank
- Networking FON Practical
- Networking FON Theory
- OS Practical
- OS Theory
- HTML
- JavaScript
- J2EE WTAD Theory
- J2EE WTAD Question Bank
- J2EE WTAD Quick Guide
- J2EE WTAD GTU Papers
- J2EE WTAD Practical
- Python
- JAVA Theory
- JAVA Practical
- MIS
Categories
- Android (55)
- c (11)
- Configure Tomcat7 (2)
- CSS (3)
- Decryption (16)
- Difference (1)
- Encryption (16)
- Error Detection and Correction Techniques (3)
- FON (27)
- Framing Technic (2)
- install Tomcat (2)
- J2EE (29)
- JAVA (13)
- JavaScript (19)
- linux (8)
- OS (17)
- PHP (11)
- Protocol (3)
- SERVER SOCKET PROGRAMING (7)
- Servlet (13)
- shell script (33)
- unix (22)
- WTAD (34)
Blog Archive
-
▼
2013
(64)
-
▼
June
(25)
- Example of command line argument in C on Linux
- Example of command line argument in Java
- AES with CBC mode example in Java
- AES with CFM mode example in Java
- AES with ECB mode example in Java
- 3DES with CFM mode example in Java
- 3DES with CBC mode example in Java
- 3DES with ECB mode example in Java
- RSA Encryption Example in Java
- JSP JDBC Example
- example of preparedstatement in java
- example of page directive in jsp
- example of jsp scripting elements
- Example of requestdispatcher
- JSTL standard tag library Example
- DES with CBC mode example in Java
- DES with CFM mode example in Java
- DES with ECB mode example in Java
- One Time Pad Encryption Example using Java code
- S-Box Example using Java
- P-Box Example using Java
- Transposition cipher example using Java
- Mono-alphabetic Substitution Cipher example using ...
- Generalized Caesar Cipher example using java
- java socket programming example
-
▼
June
(25)
Total Pageviews
© BipinRupadiya.com. Powered by Blogger.
0 comments:
Post a Comment