<%@ page import="org.apache.geronimo.daytrader.javaee6.utils.*,org.apache.geronimo.daytrader.javaee6.entities.*" session="false" %> <%! int hitCount = 0; String initTime = new java.util.Date().toString(); %> <% // setup some variables to work with later int someint1 = TradeConfig.rndInt(100) + 1; pageContext.setAttribute("someint1", new Integer(someint1)); int someint2 = TradeConfig.rndInt(100) + 1; pageContext.setAttribute("someint2", new Integer(someint2)); float somefloat1 = TradeConfig.rndFloat(100) + 1.0f; pageContext.setAttribute("somefloat1", new Float(somefloat1)); float somefloat2 = TradeConfig.rndFloat(100) + 1.0f; pageContext.setAttribute("somefloat2", new Float(somefloat2)); QuoteDataBean quoteData1 = QuoteDataBean.getRandomInstance(); pageContext.setAttribute("quoteData1", quoteData1); QuoteDataBean quoteData2 = QuoteDataBean.getRandomInstance(); pageContext.setAttribute("quoteData2", quoteData2); QuoteDataBean quoteData3 = QuoteDataBean.getRandomInstance(); pageContext.setAttribute("quoteData3", quoteData3); QuoteDataBean quoteData4 = QuoteDataBean.getRandomInstance(); pageContext.setAttribute("quoteData4", quoteData4); QuoteDataBean quoteData[] = new QuoteDataBean[4]; quoteData[0] = quoteData1; quoteData[1] = quoteData2; quoteData[2] = quoteData3; quoteData[3] = quoteData4; pageContext.setAttribute("quoteData", quoteData); %>

PING JSP EL:
Init time: <%= initTime %>

Hit Count: <%= hitCount++ %>


someint1 = <%= someint1 %>
someint2 = <%= someint2 %>
somefloat1 = <%= somefloat1 %>
somefloat2 = <%= somefloat2 %>


EL Type EL Expressions Result
Integer Arithmetic \${someint1 + someint2 - someint1 * someint2 mod someint1} ${someint1 + someint2 - someint1 * someint2 mod someint1}
Floating Point Arithmetic \${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1} ${somefloat1 + somefloat2 - somefloat1 * somefloat2 / somefloat1}
Logical Operations \${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE} ${(someint1 < someint2) && (someint1 <= someint2) || (someint1 == someint2) && !Boolean.FALSE}
Indexing Operations \${quoteData3.symbol}
\${quoteData[2].symbol}
\${quoteData4[symbol]}
\${header[host]}
\${header.host}
${quoteData3.symbol}
${quoteData[1].symbol}
${quoteData4[symbol]}
${header[host]}
${header.host}
Variable Scope Tests \${(quoteData3 == null) ? null : quoteData3}
\${(noSuchVariableAtAnyScope == null) ? null : noSuchVariableAtAnyScope}
${(quoteData3 == null) ? null : quoteData3}
${(noSuchVariableAtAnyScope == null) ? null : noSuchVariableAtAnyScope}