91-9990449935 0120-4256464 |
JSP Scriptlet tag (Scripting elements)In JSP, java code can be written inside the jsp page using the scriptlet tag. Let's see what are the scripting elements first. JSP Scripting elementsThe scripting elements provides the ability to insert java code inside the jsp. There are three types of scripting elements:
JSP scriptlet tagA scriptlet tag is used to execute java source code in JSP. Syntax is as follows: Example of JSP scriptlet tagIn this example, we are displaying a welcome message. Example of JSP scriptlet tag that prints the user nameIn 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. File: index.html File: welcome.jsp
Next TopicJsp Expression Tag
|