InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.3: Overview of JSP file content >
4.2.2.3.4: JSP syntax: Java expressions

4.2.2.3.4: JSP syntax: Java expressions

To specify a Java language expression that is resolved when the JSP file is processed, use the JSP expression tags <%= and %>. The expression is evaluated, converted into a string, and displayed. Primitive types, such as int and float, are automatically converted to string representation. In this example, foo is the class-wide variable declared in the class-wide variables and methods example:

<p>Translate the greeting <%= foo %>.</p>

When the JSP file is served, the text reads: Translate the greeting Hello.

Go to previous article: JSP syntax: Inline Java code (scriptlets) Go to next article: JSP syntax: useBean tags

 

 
Go to previous article: JSP syntax: Inline Java code (scriptlets) Go to next article: JSP syntax: useBean tags