Scriptlet let developers write java code within jsp file. Though this is not a recommended practice from the code maintenance perspective its widely used in the initial version of jsp applications.

JSP Scriptlet Syntax

<% java code fragment %>

Simple Example (github)

<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<!-- scriptlet example -->
<%out.println("Today is "+new java.util.Date()); %>

JSP Scriptlet sample program

Run JSP Scriptlet example program