The following example shows a Simple Scriptlet to Display Text in Different Font Sizes.

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Scriptlet Example</title>
</head>
<body>
<form name="f1" method="post" action="3.jsp">
	Enter Some Text: <input type="text" name="txt"/><br/>
	<br/>
	<input type ="submit" value="Submit"/><br/><br/>
</form>

<%
	String inp1=request.getParameter("txt");
	if(inp1!=null)
	{
		for(int i=1;i<=5;i++)
		{
			out.println("<span style='font-size: "+(i+20)+"px;'>" + inp1+"</span><br/>");
		}
	
	}
%>
</body>
</html>

Output

Program to Demonstrate a Simple Scriptlet to Display Text in Different Font Sizes
Program to Demonstrate a Simple Scriptlet to Display Text in Different Font Sizes
Text in Different Font Sizes
Text in Different Font Sizes