mirror of
https://github.com/apache/struts.git
synced 2026-08-31 19:35:40 +00:00
fixing OGNL demo, removing page on static methods per WW-2441
git-svn-id: https://svn.apache.org/repos/asf/struts/struts2/trunk@628329 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
@@ -18,7 +18,7 @@
|
||||
var runningOgnl = true;
|
||||
var ognlBase = "${ognlBase}";
|
||||
var jspBase = "${jspBase}";
|
||||
var ognlCount = 10;
|
||||
var ognlCount = 9;
|
||||
var jspCount = 5;
|
||||
|
||||
dojo.addOnLoad(function() {
|
||||
@@ -244,4 +244,4 @@
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -5,33 +5,21 @@
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Static fields</b>
|
||||
<b>Calling methods</b>
|
||||
</p>
|
||||
<p>
|
||||
Static fields can easily be accessed in OGNL expressions using the notation
|
||||
<i>@some.package.ClassName@PROPERTY_NAME</i> for properties, and <i>@some.package.ClassName@METHOD_NAME()</i>
|
||||
for methods.
|
||||
OGNL follows Java's syntax to execute a method.
|
||||
</p>
|
||||
<p>To access the value of the <i>CONSTANT</i> field in the ExampleAction type:</p>
|
||||
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@CONSTANT
|
||||
<i id="example">
|
||||
book.getTitle()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p>To execute the static method <i>getCurrentDate</i> in the ExampleAction type:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
@org.apache.struts2.showcase.action.ExampleAction@getCurrentDate()
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticFields.html')">[More details on static fields]</a>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/staticMethods.html')">[More details on static methods]</a>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
|
||||
</p>
|
||||
@@ -5,21 +5,39 @@
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>Calling methods</b>
|
||||
<b>Expressions</b>
|
||||
</p>
|
||||
<p>
|
||||
OGNL follows Java's syntax to execute a method.
|
||||
OGNL supports expressions using primitive values.
|
||||
</p>
|
||||
<p>To execute the <i>getTitle()</i> method on the <i>book</i> object type:</p>
|
||||
<p>Arithmetic:</p>
|
||||
<p>
|
||||
<i id="example">
|
||||
book.getTitle()
|
||||
<i id="example0">
|
||||
(6 - 2)/2
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl()">Do it for me</a>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>Logical:</p>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/methods.html')">[More details]</a>
|
||||
<i id="example1">
|
||||
(true || false) and true
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p>Equality:</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
'a' == 'a'
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports many more operators and expressions, see <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators')">[Operators Reference]</a>
|
||||
for more details.
|
||||
</p>
|
||||
@@ -4,40 +4,52 @@
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p><b>Creating arrays</b></p>
|
||||
<p>
|
||||
<b>Expressions</b>
|
||||
OGNL follows Java syntax to create arrys.
|
||||
</p>
|
||||
<p>
|
||||
OGNL supports expressions using primitive values.
|
||||
Create an array of integers:
|
||||
</p>
|
||||
<p>Arithmetic:</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
(6 - 2)/2
|
||||
new int[] {0, 1, 2}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating lists</b></p>
|
||||
<p>
|
||||
To create a list, enclose a list of comma separated expression in a pair of braces.
|
||||
</p>
|
||||
<p>
|
||||
Create a list of Strings:
|
||||
</p>
|
||||
<p>Logical:</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
(true || false) and true
|
||||
{'Is', 'there', 'any', 'body', 'out', 'there?'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating maps</b></p>
|
||||
<p>
|
||||
To create a map, use the syntax #@MAP_TYPE@{key:value}.
|
||||
</p>
|
||||
<p>
|
||||
Create a LinkedHashMap:
|
||||
</p>
|
||||
<p>Equality:</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
'a' == 'a'
|
||||
#@java.util.LinkedHashMap@{'name': 'John Galt', 'job' : 'Engineer'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
OGNL supports many more operators and expressions, see <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/apa.html#operators')">[Operators Reference]</a>
|
||||
for more details.
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/collectionConstruction.html#listConstruction')">[More details]</a>
|
||||
</p>
|
||||
@@ -4,52 +4,15 @@
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p><b>Creating arrays</b></p>
|
||||
<p>
|
||||
OGNL follows Java syntax to create arrys.
|
||||
<b>More on OGNL</b>
|
||||
</p>
|
||||
<p>
|
||||
Create an array of integers:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example0">
|
||||
new int[] {0, 1, 2}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example0')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating lists</b></p>
|
||||
<p>
|
||||
To create a list, enclose a list of comma separated expression in a pair of braces.
|
||||
</p>
|
||||
<p>
|
||||
Create a list of Strings:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example1">
|
||||
{'Is', 'there', 'any', 'body', 'out', 'there?'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example1')">Do it for me</a>
|
||||
</p>
|
||||
<p><b>Creating maps</b></p>
|
||||
<p>
|
||||
To create a map, use the syntax #@MAP_TYPE@{key:value}.
|
||||
</p>
|
||||
<p>
|
||||
Create a LinkedHashMap:
|
||||
</p>
|
||||
<p>
|
||||
<i id="example2">
|
||||
#@java.util.LinkedHashMap@{'name': 'John Galt', 'job' : 'Engineer'}
|
||||
</i>
|
||||
</p>
|
||||
<p>
|
||||
on the OGNL console and hit enter. <a href="#" onclick="execOgnl('example2')">Do it for me</a>
|
||||
There are a lot of OGNL features that we have not covered on this short tutorial.
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
<a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/collectionConstruction.html#listConstruction')">[More details]</a>
|
||||
</p>
|
||||
To learn more see the <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html')">[OGNL Documentation]</a>
|
||||
</p>
|
||||
You can keep playing with the OGNL console or
|
||||
<a href="#" onclick="startJSP()">Start JSP Interactive Demo</a>
|
||||
@@ -1,18 +0,0 @@
|
||||
<%
|
||||
request.setAttribute("decorator", "none");
|
||||
response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
|
||||
response.setHeader("Pragma","no-cache"); //HTTP 1.0
|
||||
response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
|
||||
%>
|
||||
<p>
|
||||
<b>More on OGNL</b>
|
||||
</p>
|
||||
<p>
|
||||
There are a lot of OGNL features that we have not covered on this short tutorial.
|
||||
</p>
|
||||
<br/>
|
||||
<p>
|
||||
To learn more see the <a href="#" onclick="window.open('http://www.ognl.org/2.6.9/Documentation/html/LanguageGuide/index.html')">[OGNL Documentation]</a>
|
||||
</p>
|
||||
You can keep playing with the OGNL console or
|
||||
<a href="#" onclick="startJSP()">Start JSP Interactive Demo</a>
|
||||
Reference in New Issue
Block a user