Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-11-21 15:35:08 -0500
committerpelder2006-11-21 15:35:08 -0500
commit0ff861880316a067249750eba5530b799194e002 (patch)
treeb4f902403bd17c5d83037679179c2aa248be2d51 /doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
parent85e924faca7becbb1ce6bc080e8a4c2784d69587 (diff)
downloadorg.eclipse.jet-0ff861880316a067249750eba5530b799194e002.tar.gz
org.eclipse.jet-0ff861880316a067249750eba5530b799194e002.tar.xz
org.eclipse.jet-0ff861880316a067249750eba5530b799194e002.zip
[163849] Merge in 0.7.x maintenance fixes
Diffstat (limited to 'doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml')
-rw-r--r--doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml57
1 files changed, 57 insertions, 0 deletions
diff --git a/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
new file mode 100644
index 0000000..34b69cd
--- /dev/null
+++ b/doc/org.eclipse.jet.doc/references/syntax/jetSyntaxExpressions.xhtml
@@ -0,0 +1,57 @@
+<?xml version='1.0'?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+
+ <head>
+
+ <title>JET Expressions Syntax Reference</title>
+
+ <link charset="ISO-8859-1" href="../../book.css" rel="STYLESHEET"
+ type="text/css"/>
+
+ </head>
+
+ <body>
+
+ <h2>JET Expressions Syntax Reference</h2>
+
+ <p>JET Templates may emit the result of a Java expression by
+ enclosing the Java expression between the characers
+ <code>&lt;%=</code> and <code>%&gt;</code>.</p>
+
+ <h3>Valid Expressions</h3>
+
+ <p>Expressions contain valid Java expressions. Java expressions are
+ not complete statements, and in particular, they do not include a
+ semi-colon (;). Expressions may access any Java element inscope
+ Java elemement, including fields and methods declared in
+ <a href="jetSyntaxDeclarations.xhtml">Java declarations</a>, or in
+ <a href="jetSyntaxScriptlets.xhtml">Java scriptlets</a>, or
+ <a href="implicitJavaObjectsReference.xhtml">Implicit Java
+ Objects</a>.</p>
+
+ <p>The emitted Java code for the template will evaluate the Java
+ expression and convert the result to a string (if necessary). The
+ following are examples of Java expressions:</p>
+
+ <pre>The name of the class executing is: &lt;%= this.getClass().getName() %&gt;
+
+Although slightly silly, expression may be constant, like &lt;%= 5 %&gt; and &lt;%= &quot;hello&quot; %&gt;.</pre>
+ <h3>Invalid Expressions</h3>
+
+ <p>Any syntax error in the Java expression will result errors in
+ the emitted Java code. The JET compiler does not attempt to
+ correlate the Java compile error back to the JET template. Some
+ examples:</p>
+
+ <pre>&lt;%= 3 + 4; %&gt; &lt;%-- semicolon not allowed in Java expressions --%&gt;</pre>
+ <h3>Escaping Expression characters</h3>
+
+ <p>To emit the characters <code>&lt;%=</code> in a templates
+ output, enter <code>&lt;\%=</code>. To emit <code>%&gt;</code>,
+ enter <code>%\&gt;</code></p>
+
+ </body>
+
+</html>
+

Back to the top