Archives: JSP

Java JSP – Expression Example

Following is the syntax of JSP Expression:

You can write XML equivalent of the above syntax as follows:

Following is the simple example for JSP Expression:


Java JSP – Declarations Example

A declaration declares one or more variables or methods that you can use in Java code later in the JSP file. You must declare the variable or method before you use it in the JSP file.

Following is the syntax of JSP Declarations:

You can write XML equivalent of the above syntax as follows:

Following is the simple example for JSP Declarations:


Java JSP – Scriptlet Example

A scriptlet can contain any number of JAVA language statements, variable or method declarations, or expressions that are valid in the page scripting language.

Following is the syntax of Scriptlet:

You can write XML equivalent of the above syntax as follows:

Any text, HTML tags, or JSP elements you write must be outside the scriptlet. Following is the simple and first example for JSP: