Author: nbubna
Date: Fri Apr 27 20:56:54 2007
New Revision: 533291

URL: http://svn.apache.org/viewvc?view=rev&rev=533291
Log:
fix misc problems with LinkTool demos (merge of r533290)

Modified:
    velocity/tools/branches/2.x/examples/showcase/VM_global_library.vm
    velocity/tools/branches/2.x/examples/showcase/link.vm

Modified: velocity/tools/branches/2.x/examples/showcase/VM_global_library.vm
URL: 
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/examples/showcase/VM_global_library.vm?view=diff&rev=533291&r1=533290&r2=533291
==============================================================================
--- velocity/tools/branches/2.x/examples/showcase/VM_global_library.vm 
(original)
+++ velocity/tools/branches/2.x/examples/showcase/VM_global_library.vm Fri Apr 
27 20:56:54 2007
@@ -108,7 +108,7 @@
     #foreach( $param in $request.parameterMap.keySet() )
       #foreach( $value in $params.getStrings($param) )
         #if( $param != $method )
-          <input type="hidden" name="$param" value="$value">
+          <input type="hidden" name="$param" value="$esc.html($value)">
         #end
       #end
     #end
@@ -145,7 +145,7 @@
     #foreach( $param in $request.parameterMap.keySet() )
       #foreach( $value in $params.getStrings($param) )
         #if( $param != $method1 && $param != $method2 )
-          <input type="hidden" name="$param" value="$value">
+          <input type="hidden" name="$param" value="$esc.html($value}">
         #end
       #end
     #end
@@ -184,7 +184,7 @@
     #foreach( $param in $request.parameterMap.keySet() )
       #foreach( $value in $params.getStrings($param) )
         #if( $param != $method1 && $param != $method2 && $param != $method3 )
-          <input type="hidden" name="$param" value="$value">
+          <input type="hidden" name="$param" value="$esc.html($value}">
         #end
       #end
     #end
@@ -217,7 +217,7 @@
     #foreach( $param in $request.parameterMap.keySet() )
       #foreach( $value in $params.getStrings($param) )
         #if( $param != 'custom' )
-          <input type="hidden" name="$param" value="$value">
+          <input type="hidden" name="$param" value="$esc.html($value}">
         #end
       #end
     #end

Modified: velocity/tools/branches/2.x/examples/showcase/link.vm
URL: 
http://svn.apache.org/viewvc/velocity/tools/branches/2.x/examples/showcase/link.vm?view=diff&rev=533291&r1=533290&r2=533291
==============================================================================
--- velocity/tools/branches/2.x/examples/showcase/link.vm (original)
+++ velocity/tools/branches/2.x/examples/showcase/link.vm Fri Apr 27 20:56:54 
2007
@@ -70,10 +70,10 @@
 #demoAlt( 'link' 'params' $desc )
 
 
-#set( $desc = "Returns the URI that addresses this web application. E.g. 
<code>http://myserver.net/myapp</code>. This string does not end with a "/"." )
+#set( $desc = "Returns the URI that addresses this web application. E.g. 
<code>http://myserver.net/myapp</code>. This string does not end with a 
${esc.q}/${esc.q}." )
 #demo( 'link' 'contextURL' $desc )
 
-#set( $desc = "Returns the context path that addresses this web application, 
e.g. <code>/myapp</code>. This string starts with a "/" but does not end with a 
"/"." )
+#set( $desc = "Returns the context path that addresses this web application, 
e.g. <code>/myapp</code>. This string starts with a ${esc.q}/${esc.q} but does 
not end with a ${esc.q}/${esc.q}." )
 #demo( 'link' 'contextPath' $desc )
 
 #set( $desc = "Retrieves the path for the current request regardless of 
whether this is a direct request or an include by the RequestDispatcher." )
@@ -96,12 +96,12 @@
 <div align="center">
   <a name="fullDemo"><h3>$demo.mainExampleHeader</h3></a>
 <form method="post" action="$link.self.anchor('fullDemo')">
-<textarea name="demo" rows="5" cols="65">##
-#if( $params.demo )##
-$params.demo##
+<textarea name="fullDemo" rows="5" cols="65">##
+#if( $params.fullDemo )##
+$params.fullDemo##
 #else##
-## NOTE: this first line is done in the actual page,
-##       because #set() doesn't work in these demos
+${esc.h}${esc.h} NOTE: this first line is done in the actual page,
+${esc.h}${esc.h}       because ${esc.h}set() doesn't work in these demos
 ${esc.h}set( ${esc.d}base = ${esc.d}link.self.anchor('fullDemo') )
 <a href="${esc.d}base.param('select','this')">this</a>
 <a href="${esc.d}base.param('select','that')">that</a>##
@@ -114,10 +114,10 @@
   #end
 </form>
 
-#if( $params.demo )
+#if( $params.fullDemo )
 $demo.mainResultsIntro:
 <pre>
-  $render.eval($params.demo)
+  $render.eval($params.fullDemo)
 </pre>
 #end
 </div>


Reply via email to