Created
January 24, 2017 04:13
-
-
Save nitincoded/e1b84b8487355736d37699ba8a40b328 to your computer and use it in GitHub Desktop.
JSTL Demo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> | |
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %> | |
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> | |
<%@ taglib prefix="sql" uri="http://java.sun.com/jsp/jstl/sql" %> | |
This is a JSP test<br /> | |
<c:out value="This is JSTL" /> | |
<br /> | |
<% | |
int j=5; | |
%> | |
<c:catch> | |
<% int a=10/0; %> | |
</c:catch> | |
<br /> | |
<c:import url="https://gist.githubusercontent.com/nsipplswezey/4e538659f0c02f30fc4bc3fc74c34abd/raw/413831723c17675a11788ee788dabb106e862724/.gistup"></c:import> | |
<br /> | |
<c:forEach var="number" begin="5" end="10"> <%-- <c:forEach var="row" items="${prlist.rows}"> --%> | |
<c:out value="${number}" /> | |
</c:forEach> | |
<br /> | |
<c:import var="conte" url="https://gist.githubusercontent.com/nsipplswezey/4e538659f0c02f30fc4bc3fc74c34abd/raw/413831723c17675a11788ee788dabb106e862724/.gistup"></c:import> | |
<p><i><c:out value="${conte}" /></i></p> | |
<c:set var="testing" value="blah"/> | |
<c:out value="${testing}"/> | |
<br /> | |
<c:set var="number" value="${200}"> | |
<c:if test="${number<500}"> | |
<c:out value="number is less than 500"></c:out> | |
</c:if> | |
<br /> | |
<!-- c:redirect url="http://www.javatpoint.com"></c:redirect --> | |
<c:set value="21" var="i"></c:set> | |
<c:choose> | |
<c:when test="${i%2==0}"> | |
<c:out value="Even Number"></c:out> | |
</c:when> | |
<c:otherwise> | |
<c:out value="Odd Number"></c:out> | |
</c:otherwise> | |
</c:choose> | |
<br /> | |
<c:set value="rahul kumar" var="name"></c:set> | |
<c:out value="${fn:toUpperCase(name)}"></c:out> | |
<br /> | |
<c:set value="abcdefgh" var="name"></c:set> | |
<c:out value="${fn:substring(name,2,5)}"></c:out> | |
<br /> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment