A scriptlet tag is used to execute java source code in JSP.
The general form is:
< ><% java source code %>
<html> <body> <% out.print("Welcome to java8s.com"); %> </body> </html>
Let’s see another example of JSP scriptlet tag that displays the user name. In this example, we have created two files index.jsp and welcome.jsp. The index.jsp file gets the username from the user and the welcome.jsp file prints the username with the welcome message.
<html> <body> <form action="welcome.jsp"> <input type="text" name="uname"></br></br> <input type="submit" value="ok"> </form> </body> </html>
<html> <body> <% String str=request.getParameter("uname"); out.print("Welcome"+str); %> </body> </html>
Silan Software is one of the India's leading provider of offline & online training for Java, Python, AI (Machine Learning, Deep Learning), Data Science, Software Development & many more emerging Technologies.
We provide Academic Training || Industrial Training || Corporate Training || Internship || Java || Python || AI using Python || Data Science etc