A scriptlet tag is used to execute java source code in JSP.
The general form is:
<% java source code %>
<% out.print("welcome to java8s.com"); %>
Let’s see another example of JSP scriptlet tag that displays the user name. In this example, we have created two files index.html and welcome.jsp. The index.html file gets the username from the user and the welcome.jsp file prints the username with the welcome message.