Scriptlet in JSP

How are Scriptlets used in JSP?


JSP Scriplet contains a valid set of scripting code that can be used in a JSP page.



Based on the scripting language the code is tranformed into that language.If the scripting language is set to java, the code is inserted as JSP Page servlet. The main advantage of JSP Scriptlets is that it can be accessed from anywhere within the JSP page.


out.println("JSP Scriptlet");
Result :

JSP Scriptlet

In the above example we have just included a JSP code to print the text "JSP Scriptlet".

Ask Questions

Ask Question