General Purpose Tags:
1. <c: out>
One of the general purpose core library tag is <c: out>. The main function of the this tag is to display the output to the user. It works like expression tag in jsp <%= ---%>.
Form1:
1. <c:out value = “MYJAVAHUB”/>
It prints MYJAVAHUB in to the Jsp.
2. <c: out value = “${param.uname}”/>
It prints the value of request parameter uname of the Jsp.
Form2:
<c:out value = “${param.uname}” default = “Java Jobs”/>
If the main value is not available or it evaluates to null then default value will be considered.
Attributes:
<c: out> defines the following 3 attributes.
1. value: It is the mandatory attribute and it is for providing the value.It should be either literal (or) runtime expression.
2. default: It is optional attribute and it is to provide default value.
Jsp engine considered its value if and only if the value attributes evaluates to null.
3. Escape xml: True if the tag should escape special XML characters
test.jsp
<%@ page isELIgnored="false" %> <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <h1> WELCOME TO ::: <c:out value="${param.uname}" default="MYJAVAHUB "></c:out> </h1> |
I think this is an informative post and it is very useful and knowledgeable. therefore, I would like to thank you for the efforts you have made in writing this article. world wide news
ReplyDelete