home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / xampp / xampp-tomcat-addon-1.4.9-installer.exe / functions.jsp < prev    next >
Encoding:
Text File  |  2004-08-28  |  1.9 KB  |  65 lines

  1. <!--
  2.   Copyright 2004 The Apache Software Foundation
  3.  
  4.   Licensed under the Apache License, Version 2.0 (the "License");
  5.   you may not use this file except in compliance with the License.
  6.   You may obtain a copy of the License at
  7.  
  8.       http://www.apache.org/licenses/LICENSE-2.0
  9.  
  10.   Unless required by applicable law or agreed to in writing, software
  11.   distributed under the License is distributed on an "AS IS" BASIS,
  12.   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13.   See the License for the specific language governing permissions and
  14.   limitations under the License.
  15. -->
  16. <%@ taglib prefix="my" uri="http://jakarta.apache.org/tomcat/jsp2-example-taglib"%>
  17.  
  18. <html>
  19.   <head>
  20.     <title>JSP 2.0 Expression Language - Functions</title>
  21.   </head>
  22.   <body>
  23.     <h1>JSP 2.0 Expression Language - Functions</h1>
  24.     <hr>
  25.     An upgrade from the JSTL expression language, the JSP 2.0 EL also
  26.     allows for simple function invocation.  Functions are defined
  27.     by tag libraries and are implemented by a Java programmer as 
  28.     static methods.
  29.  
  30.     <blockquote>
  31.       <u><b>Change Parameter</b></u>
  32.       <form action="functions.jsp" method="GET">
  33.       foo = <input type="text" name="foo" value="${param['foo']}">
  34.           <input type="submit">
  35.       </form>
  36.       <br>
  37.       <code>
  38.         <table border="1">
  39.           <thead>
  40.         <td><b>EL Expression</b></td>
  41.         <td><b>Result</b></td>
  42.       </thead>
  43.       <tr>
  44.         <td>\${param["foo"]}</td>
  45.         <td>${param["foo"]} </td>
  46.       </tr>
  47.       <tr>
  48.         <td>\${my:reverse(param["foo"])}</td>
  49.         <td>${my:reverse(param["foo"])} </td>
  50.       </tr>
  51.       <tr>
  52.         <td>\${my:reverse(my:reverse(param["foo"]))}</td>
  53.         <td>${my:reverse(my:reverse(param["foo"]))} </td>
  54.       </tr>
  55.       <tr>
  56.         <td>\${my:countVowels(param["foo"])}</td>
  57.         <td>${my:countVowels(param["foo"])} </td>
  58.       </tr>
  59.     </table>
  60.       </code>
  61.     </blockquote>
  62.   </body>
  63. </html>
  64.  
  65.