In this example we are printing the username using the expression tag.
Example of jsp expression. You can now include a JSP EL expression in the body of a tag or any other tag with the same syntax you use for attributes. Here we are simply passing the expression of values inside expression tag. Different examples below show different uses of expressions.
In this example we will see how EL is used as an operator to add two numbers 12 and get the output respectively. Into the JSP output Hello JSP. JSP Expressions A JSP expression is used to insert the value of a scripting language expression converted into a string into the data stream returned to the client.
For example the tag simply inserts its content within the body of a JSP. JSP expression tag Examples. Int i 0.
Lets take a simple example for understanding the JSP expression language indexjsp Name welcomejsp. It allows create expressions like arithmetic and logical. For example in above JSP Example I am using page directive to to instruct container JSP translator to import the Date class.
A JSP expression element contains a scripting language expression that is evaluated converted to a String and inserted where the expression appears in the JSP file. To get a better idea on how expression works in JSP we will see below example. Here the expression is the arithmetic or logical expression.
12 lignes JSP Expression Language Important Points. Expression Tag. JSP expression within the HTML comment will be evaluated.