You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@velocity.apache.org by nb...@apache.org on 2003/07/22 20:39:56 UTC

cvs commit: jakarta-velocity-tools/examples/simple index.vm

nbubna      2003/07/22 11:39:56

  Modified:    examples/simple/WEB-INF toolbox.xml
               examples/simple index.vm
  Log:
  make simple example a little more interesting
  
  Revision  Changes    Path
  1.2       +20 -4     jakarta-velocity-tools/examples/simple/WEB-INF/toolbox.xml
  
  Index: toolbox.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity-tools/examples/simple/WEB-INF/toolbox.xml,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- toolbox.xml	5 Mar 2003 06:36:33 -0000	1.1
  +++ toolbox.xml	22 Jul 2003 18:39:56 -0000	1.2
  @@ -1,11 +1,27 @@
   <?xml version="1.0"?>
  -
   <toolbox>
  -
     <tool>
        <key>toytool</key>
        <class>ToyTool</class>
     </tool>
  -
  +  <data type="number">
  +    <key>version</key>
  +    <value>1.1</value>
  +  </data>
  +  <data type="boolean">
  +    <key>isSimple</key>
  +    <value>true</value>
  +  </data>
  +  <data type="string">
  +    <key>foo</key>
  +    <value>this is foo.</value>
  +  </data>
  +  <data type="string">
  +    <key>bar</key>
  +    <value>this is bar.</value>
  +  </data>
  +  <tool>
  +    <key>map</key>
  +    <class>java.util.HashMap</class>
  +  </tool>
   </toolbox>
  -
  
  
  
  1.2       +16 -0     jakarta-velocity-tools/examples/simple/index.vm
  
  Index: index.vm
  ===================================================================
  RCS file: /home/cvs/jakarta-velocity-tools/examples/simple/index.vm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- index.vm	5 Mar 2003 06:36:33 -0000	1.1
  +++ index.vm	22 Jul 2003 18:39:56 -0000	1.2
  @@ -14,6 +14,22 @@
   
   Lets count : #foreach($i in [1..5])$i #end
   
  +<br>
  +<br>
  +
  +Let's play with a hashmap:<br>
  +first add foo: $map.put("foo",$foo)<br>
  +then add bar: $map.put("bar",$bar)<br>
  +<br>
  +and that gives us $map
  +
  +<br>
  +<br>
  +
  +#if( $isSimple )
  +This is simple app version ${version}.
  +#end
  +
   </body>
   </html>
   
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org