fn tag(Function Tag)
Fn_Tags.jsp:
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<html>
<head>
<title>Function Tags</title>
</head>
<body>
<c:set var="theString" value="This String Contains Aditya"/>
<c:if test="${fn:contains(theString, 'aditya')}">
<p>Found string with aditya<p>
</c:if>
<c:if test="${fn:contains(theString, 'Aditya')}">
<p>Found string with Aditya<p>
</c:if>
<c:set var="string" value="Aditya: This is first String."/>
<c:if test="${fn:startsWith(string, 'Aditya')}">
This String starts with Aditya
</c:if>
<br />
<c:if test="${fn:startsWith(string, 'aditya')}">
This String Starts with aditya
</c:if>
</body>
</html>
0 comments:
Post a Comment