fn:toUpperCase tag of Function Tag Library

What is "fn:toUpperCase" tag of Function Tag Library?

Explanation

"fn:toUpperCase" is a string function of JSP Standard Tag Library(JSTL). This function is used to convert a string to uppercase.

Syntax:


String:fn:toUpperCase(string)

In the above syntax the "string" is of Data type "String".

Example :


<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions"
prefix="fn" %>
<html>
<form>
USERNAME:<input type="text" name="usr" size="25">
<p></p>
<input type="submit" value="Submit">
</form>
Your Username in Uppercase::
<c:out value="${fn:toUpperCase(param.usr)}" />

In the above example the username will be converted to uppercase when the form is submitted.The "param" attribute is used to get the username.

Ask Questions

Ask Question