Re: Escaping in string definitions

2002-04-24 Thread Barbara Baughman
a syntax error, so there wouldn't be a problem with backwards compatibility. Can someone confirm that? That would yield: #set($bar=thingy) #set($foo=This $bar is fine) $foo This thingy is fine #set($bar=thingy) #set($foo='This $bar is ''fine''') $foo This $bar is 'fine' Barbara Baughman

Re: Help,about the path

2002-07-26 Thread Barbara Baughman
. It's all there. I have some notes to myself on setting up Velocity for a web application that may be useful in just seeing how someone does it for real. Use this only as another example, not the final word... http://www.utdallas.edu/~baughman/velocity.html Barbara Baughman X2157 On Fri, 26 Jul

Re: Special logic for last iteration of collection

2004-01-28 Thread Barbara Baughman
Try (#foreach($element in $list)$element#if($velocityCount==list.size()))#else,#end Starts with a (, then the element followed by a comma if we're not on the last element, followed by a ) if this is the last element. Barbara Baughman X2157 On Wed, 28 Jan 2004, White, Joshua A (HTSC, CASD

RE: How to get unprocessed template from VelocityEngine?

2004-05-20 Thread Barbara Baughman
, , incTpl); String vtl = w.toString(); Barbara Baughman X2157 On Thu, 20 May 2004, Ford, Peter wrote: That might work... I could do this in my code: String incTpl = #include($ + tpl + ); .. Writer w = new StringWriter(); velocityEngine.evaluate(ctx, w, , incTpl); String vtl = w.toString

Re: How do I access superclass methods and properties?

2004-07-23 Thread Barbara Baughman
I access superclass methods constantly with no problems. Just follow the rules that Velocity only references public methods in public classes. So A has to be public, B has to be public, and the method has to be public. Barbara Baughman X2157 On Fri, 23 Jul 2004, Michael Yui wrote: Hi, Can

Re: Can we access velocity contexts from inside javascript

2004-10-13 Thread Barbara Baughman
code already has the information javascript needs from the Velocity context before sending it to the client. Barbara Baughman X2157 On Wed, 13 Oct 2004, Shankar Banerjee wrote: Hi , We are using html and javascript for rendering an UI. We are also using struts and velocity to interface

Re: Velocity

2004-10-15 Thread Barbara Baughman
of the first letter after get. Barbara Baughman X2157 On Fri, 15 Oct 2004, Mike Kienenberger wrote: Wong, RYM (Richard) [EMAIL PROTECTED] wrote: Hi, I cannot find out whether VTL is case sensitive or not in the on-line reference manual. e.g. Are the reference variables $var and $VaR

Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
/info/facstaff.vm The template output only provides one blank line, even though the size() method indicates there are 84 members. Any hints or tips? Barbara Baughman X2157 - To unsubscribe, e-mail: [EMAIL PROTECTED

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
Actually, I was trying to create a class that was immutable, which means I wouldn't want to implement Collection. If I have the class just implement Iterator would that do it? Barbara Baughman X2157 On Mon, 18 Oct 2004, Simon Christian wrote: Hi Barbara, I believe that either your class

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
Well, I think I answered my own question. It's NO. Barbara Baughman X2157 On Mon, 18 Oct 2004, Barbara Baughman wrote: Actually, I was trying to create a class that was immutable, which means I wouldn't want to implement Collection. If I have the class just implement Iterator would that do

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
Thanks to Simon for pointing me in the right direction. Implementing all the methods in the Collection interface did the trick. Barbara Baughman X2157 On Mon, 18 Oct 2004, Barbara Baughman wrote: Well, I think I answered my own question. It's NO. Barbara Baughman X2157 On Mon, 18 Oct

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
to sort out what Generics can and cannot do, in the end I think they are a BIG plus for developers who can adapt. Barbara Baughman X2157 On Tue, 19 Oct 2004, Shinobu Kawai wrote: Hi Barbara, Actually, I was trying to create a class that was immutable, which means I wouldn't want to implement

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
I don't reimplement any functions. I call on the function for the underlying object. Barbara Baughman X2157 On Tue, 19 Oct 2004, Shinobu Kawai wrote: Hi Barbara, Actually, I was trying to create a class that was immutable, which means I wouldn't want to implement Collection. If I have

Re: Defining iterator for #foreach

2004-10-18 Thread Barbara Baughman
VelocityContext context = new VelocityContext(); ListMapString, String list = new ArrayListMapString, String(); MapString, String map1 = new HashMapString, String(); map1.put(id, 1); map1.put(name, Barbara Baughman); list.add(Collections.unmodifiableMap(Collections.synchronizedMap(map1))); MapString

RE: Defining iterator for #foreach

2004-10-19 Thread Barbara Baughman
(so many the compiler wouldn't print all of them), I don't know that I would have bothered with the extra classes and substantial rewrite. I'd just add generics here and there to programs as I found the time. Barbara Baughman X2157 On Mon, 18 Oct 2004, Mike Curwen wrote: So

Re: jdk 1.5

2004-11-04 Thread Barbara Baughman
I've been using Velocity with jdk 1.5 with no problems. I don't use every feature, but I wouldn't anticipate any problems. I have a lot of programs written for jdk 1.4 that run just fine in 1.5. Moreover, the JAVA developers took great pains to make sure there would be no problems. Barbara

Re: null in velocity

2004-12-02 Thread Barbara Baughman
. Then you would have to create your own method in the $car object. #if ($car.hasFuel()) BTW, always use '==' instead of '=' when making comparisons in Velocity. Barbara Baughman X2157 On Thu, 2 Dec 2004, THE ULTIMATE SUBBIAH wrote: How to check for null in velocity for eg. I load a class

Re: template location question

2004-12-13 Thread Barbara Baughman
Instead of changing the resource loader, you can have everything under the same directory, with subdirectories for each language. Then build the correct template name, including the appropriate subdirectory, in your servlet. Barbara Baughman X2157 On Tue, 14 Dec 2004, Geercken Uwe wrote

Re: Re[2]: Custom Resource Loader

2004-12-14 Thread Barbara Baughman
but can choose from multiple configurations. At least I think in theory this should be true. Never tried it. Barbara Baughman X2157 On Wed, 15 Dec 2004, Shinobu Kawai wrote: Hi Stan, Still, I think, it would be a very good idea to slightly redesign VelocityEngine class for better support

Re: Classloading problem of using velocity with tomcat

2005-01-20 Thread Barbara Baughman
object. Barbara Baughman X2157 On Thu, 20 Jan 2005, Will Glass-Husain wrote: What problems? Can you be a bit more specific? Again, you have a choice. You can put the Velocity jar either in Tomcat/common/lib, or in WEB-INF/lib. With the latest set of source code, you can then put

Re: Immutable pojos as context objects

2005-02-11 Thread Barbara Baughman
that would change the underlying object. Then have a method or constructor that provides a version of the underlying class with this boolean field set to false. Pass this immutable version of the class to the Velocity context. -- Barbara

Re: tomcat 4.1.31 and velocity - template location problem

2005-02-22 Thread Barbara Baughman
servlet running. Barbara Baughman X2157 On Mon, 21 Feb 2005, Michael Salmon wrote: hi folks my templates don't load from where I want. In particular here is what I'm doing: 1. servlet extends VelocityServlet. and calls Velocity.init(). I dont override loadConfiguration() 2. In my webapp

Re: Velocity vs. FreeMarker

2005-02-24 Thread Barbara Baughman
. Velocity gives more control to the programmer, providing additional tools as appropriate. Many tool programs have already been written and are readily available in the Velocity Tools project. I might also add that the Velocity community is very helpful and supportive. Super, in fact! Barbara

Re: question on velocity-tools-1.1 examples :: simple.war

2005-03-04 Thread Barbara Baughman
This is a Tomcat problem. I find if there are too many web applications under tomcat, at some point I get an out of memory error. My guess is that this could be the one-more-application that broke the camel's back. Barbara Baughman X2157 On Fri, 4 Mar 2005, Ryan M. Waters wrote: I've read

Re: Password admin with velocity

2005-03-18 Thread Barbara Baughman
()); MessageDigest md4 = MessageDigest.getInstance(MD4); return md4.digest(s.getBytes()); } Look up gnu.crypto in Google. Barbara Baughman X2157 On Fri, 18 Mar 2005, Doug Carter wrote: Hi all, Has anyone implemented a JDBCRealm and MD5 encrypted passwords with a velocity app? I've

Re: Problem with null in velocity template

2005-03-18 Thread Barbara Baughman
Read the User's Guide, under Quiet Reference Notation. Barbara Baughman X2157 On Fri, 18 Mar 2005, Madasu, Satya K. wrote: Hi, If I have a null value to the variable then the script is displaying as is with the $ sign on the web page. How to overcome this problem? Please let me know. We

Re: Passing a Javascript generated value into velocity

2005-03-21 Thread Barbara Baughman
is already done. Barbara Baughman X2157 On Mon, 21 Mar 2005, Sanden, Steve wrote: Hello everyone, Just wanted to know how it might be possible to do the following: I have a modal dialog that accepts a string value. //simple javascript that evaluates length of a string @ submit

Re: Velocity Iterator warning

2005-03-29 Thread Barbara Baughman
. Barbara Baughman X2157 On Tue, 29 Mar 2005, Chacko, Raj wrote: Hi All How to handle this sort of warning? Velocity [warn] Warning! The iterative is an Iterator in the #foreach() loop at 0,0] in template /data.vm. Because it's not resetable, if used in more than once, this may lead

Re: Comparing null...

2005-03-30 Thread Barbara Baughman
. Barbara Baughman X2157 On Wed, 30 Mar 2005, tarun Narang wrote: hi shashi try this too #if(!$type) ...statements #end - Original Message - From: Shinobu Kawai [EMAIL PROTECTED] To: Velocity Users List velocity-user@jakarta.apache.org Sent: Wednesday, March 30, 2005 10:29 PM

Re: help - text within { } is not rendered by the engine

2005-03-31 Thread Barbara Baughman
text - $c1{ More text $c1{something More text - $c1{ More text If $c1 is in the Velocity context with a value Hello, then it is $c1{something} -Hello{ $c1{something -Hello{ $c1{something More text -Hello{ More text Not good behavior for a templating language. Barbara Baughman X2157

Re: help - text within { } is not rendered by the engine

2005-03-31 Thread Barbara Baughman
But if $c1 is not in the context, you cannot get the following result using Velocity no matter the Velocity code. $c1{something} Using your idea: ${c1}{something} - ${c1}{something} Barbara Baughman X2157 On Fri, 1 Apr 2005, Dimitrios Kolovos wrote: You can always use the formal way: ${c1

Re: Velocity vs JSP vs FreeMarker

2005-04-07 Thread Barbara Baughman
, character number, and a short explanation. Barbara Baughman X2157 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

Re: Velocity security

2005-04-22 Thread Barbara Baughman
in the VelocityEngine, so you might also have a directory of files that can be used by all users. So when someone went to the user's web page, you would look up the directory for that user, setup the appropriate VelocityEngine, set the VelocityContext, and do a MergeTemplate. Barbara Baughman X2157 On Fri

Re: template string question

2005-05-25 Thread Barbara Baughman
Since Velocity is using Java, you have access to all of the public methods of the classes in the java.lang package. String methods are included. #set ($string=TehpaoLiu) $string.substring(0,6) Barbara Baughman X2157 On Wed, 25 May 2005, Liu, Teh P wrote: Hi All, I have a string TehpaoLiu

Re: Has anybody got a chance?

2005-05-26 Thread Barbara Baughman
without worrying about messing up base programming code. As someone who has maintained both kinds of applications, it's no contest. Velocity wins. Barbara Baughman X2157 On Thu, 26 May 2005, Jason Pettiss wrote: The real advantages Velocity has are: - firmer separation of logic from

Re: Use of Velocity for Email Generation (from Template)

2005-06-13 Thread Barbara Baughman
I use it all the time for automated email notifications. Barbara Baughman X2157 On Mon, 13 Jun 2005, Corbin, James wrote: Hello, I am starting to research Velocity as an option to create email text from a template and wondered if this was a valid use of this tool. It seems

Re: Help with VelocityViewServlet

2005-07-12 Thread Barbara Baughman
, you'd be getting an Exception message. Barbara Baughman X2157 On Tue, 12 Jul 2005, Withers John Z wrote: Greetings! I've been trying to sub-class the VelocityViewServlet to implement a web application I've been working on. I'm pretty sure I've over-ridden the various methods properly

Re: set a value in a macro

2005-08-23 Thread Barbara Baughman
they are always there. I'm very impressed with Velocity's speed. I'm willing to trade minor inefficiency for speed in coding. Barbara Baughman X2157 On Tue, 23 Aug 2005, Robert Koberg wrote: Hi, Say I have a VM_global_library.vm that has a macro like: #macro (roleList) #set ($roles = [foo, bar

Re: Template Variable Substitution Status

2005-11-21 Thread Barbara Baughman
the reference, but processing continues. This is not considered to be an error but rather a warning. For a general purpose template, the template designer must have a list of possible context fields and design the template accordingly. Barbara Baughman X2157 On Mon, 21 Nov 2005, Jitendra Kumar wrote

Re: Image data (from byte array) merging

2005-11-28 Thread Barbara Baughman
changes every reference to a String as it parses, so passing binary data to Velocity for interpreation will not be useful. Barbara Baughman X2157 On Mon, 28 Nov 2005, Antony Bourgois wrote: Hi I have image data from a byte array I need to populate (append in fact) into a template. I've come

Re: problem accessing extended methods from template

2005-12-12 Thread Barbara Baughman
Class B needs to be public public class B extends A { Class A needs to be public public Class A { Barbara Baughman X2157 On Mon, 12 Dec 2005, john oh wrote: Hello, I have a class (B) that extends another (A) like so === class A{ protected

Re: Rationale for Velocity?

2006-01-11 Thread Barbara Baughman
that have precisely what I would want to list. Another alternative is to provide a public method to the context that will screen a larger list to a smaller list for the #foreach directive. Barbara Baughman X2157 On Wed, 11 Jan 2006, Paul Gillen wrote: Thanks for the prompt response Will. My

RE: OutOfMemoryException Processing Velocity Template

2006-02-07 Thread Barbara Baughman
method to clear out the VelocityEngine? Barbara Baughman X2157 On Tue, 7 Feb 2006, e v a n wrote: Hmm. I wasn't aware of the leak issue, I'll make a note of that. As for other work arounds, I have one that will work just fine for my situation. But I'm still curious about the specialized tiles

Re: Can velocity load a properties file ?

2006-04-20 Thread Barbara Baughman
by printing the value of the set variable. Barbara Baughman X2157 On Thu, 20 Apr 2006, trad-ex wrote: Hi All, I tried to load property resource bundle file, but failed to get an instance of FileInputStream. My code is below: #set( $fStreamClass = $util.class.forName(java.io.FileInputStream) ) #set

Re: Dereferencing a Reference

2006-06-07 Thread Barbara Baughman
Try using a Map interface object like HashMap or TreeMap. HashMapString, String hm=new HashMapString, String(); hm.put(a,apple); hm.put(b,blueberry); ctx.put(map,hm); Then in Velocity: #foreach ($key in $map.keySet()) $key $map.get($key) #end Barbara Baughman X2157 On Wed, 7 Jun 2006

Re: Dereferencing a Reference

2006-06-08 Thread Barbara Baughman
Cool. Thanks. Barbara Baughman X2157 On Thu, 8 Jun 2006, Keith R. Bennett wrote: Barbara - Jakarta Commons Collections has all kinds of neat classes and utilities for this kind of thing. While unfortunately they don't support generics, larvalabs has a product that does. The URL http

Re: Any way to evaluate an expression without generating empty line on output?

2006-06-16 Thread Barbara Baughman
Use !$something. Barbara Baughman X2157 On Fri, 16 Jun 2006, Colbert Philippe wrote: I am writing and using Velocity macros. Inside the macro, I evaluate certain expressions using $!somexpression. However, I noticed that Velocity generates an empty line for each of the silent expression

Re: Putting key/value pair into hashmap from velocity template

2006-07-19 Thread Barbara Baughman
try $myMap.put(123,test) Barbara Baughman X2157 On Wed, 19 Jul 2006, Matthias Hendler wrote: Hello, I try to put a key/value pair to a hashmap from velocity template. First I put a new hashmap object into velocity context named myMap. In my templates I can write: ... $myMap.clear

Re: some escape character

2006-08-04 Thread Barbara Baughman
think Velocity has anyway. I use this quite often in HTML-based templates. Barbara Baughman X2157 On Fri, 4 Aug 2006, dizzi wrote: It has probably pretty simple solution but i cant figure it anyway :) #macro(button $name $url) div class=buttona href=$url$name/a/div #end #set ($AJAXurl

Re: Bean Introspection

2006-08-25 Thread Barbara Baughman
to information that is specifically designated for their use. So you can use a tool, but I'm hoping basic Velocity would never incorporate this. Barbara Baughman X2157 On Sat, 26 Aug 2006, Gyanesh M Khanolkar wrote: Hi, I have read in many forums for requests to read public fields ALSO incase

Re: Bean Introspection

2006-08-25 Thread Barbara Baughman
There could be public constants within the system that are used within the JVM, but the programmer never meant to make them available to outsiders. Things like allowable minimums and maximums, etc. may be intended to be rather private. Barbara Baughman X2157 On Fri, 25 Aug 2006, Nathan Bubna

Re: Keep vectors value in context

2006-08-30 Thread Barbara Baughman
that automatically send the session objects to the Velocity context. The VelocityContext is rebuilt for every HTTP request, either explicityly or behind the scenes. The best you can do is avoid repopulating the vectors. Barbara Baughman X2157 On Wed, 30 Aug 2006, Carlo Torniai wrote: Hi there. I'm

RE: Beginner trying to install velocity to apache server

2006-09-22 Thread Barbara Baughman
I started as a newbie with Tomcat and Velocity and JAVA in the school of hard knocks, before Struts and Click and Velocity Tools. It took a while, but I wouldn't say it's an impossible task if you have some time to play. I know the Velocity list will give you great help. Barbara Baughman X2157

RE: Problem getting value from Map.

2006-10-06 Thread Barbara Baughman
My guess is because a is translated by Velocity as a String, not a Name object. Barbara Baughman X2157 On Fri, 6 Oct 2006, Daryl Beattie wrote: Hi Matthias (and Nathan), Thanks for your quick replies. I have changed my classes to public, and that helps a bit. Actually

Re: How to pass values between velocity and servlet

2006-10-12 Thread Barbara Baughman
also lets you share session attributes among applications within the same instance of Tomcat. http://server/app?parameter=something Barbara Baughman X2157 On Thu, 12 Oct 2006 [EMAIL PROTECTED] wrote: I thought about that but unfortunately the value has to be passed even if users don't use

Re: How to pass values between velocity and servlet

2006-10-12 Thread Barbara Baughman
String number=(String) request.getParameter(number); Barbara Baughman X2157 On Thu, 12 Oct 2006 [EMAIL PROTECTED] wrote: Thank you all, that's what I'm looking for. Sorry about the confusion but this is my first time using velocity, but how to do you tell the servlet to pick up the URL