Hi all,
I'm just in the process of moving over to the velocity world (from JSP tags
world), so please excuse if I'm doing something obviously wrong.
Basically, I'm trying to display form errors in relevant parts of the interface
using the following code snippet:
#if
Hi,
Please excuse this thread. I had another application.properties file lurking
in my classpath that was being read rather than the one that I was updating.
So, it looks as if Velocity will output the properties key if it can't find a
value for the key.
Cheers
Robin
-Original
You can also use plain VTL:
#set( $id = $number )
#set( $len = $id.length() - 4 )
$id.substring($len)
To simplify the use, you can create a macro for this:
#macro( fourdigits $number )#*
*##* #local( $id $len ) *##*-- optional directive, avoids polluting
context
*##set( $id =
Hi, i have a sugestion for you to change in the User's guide:
// in section Case Substitution, you make the following example:
$foo.getBar()
## is the same as
$foo.Bar
// ...then in the text below that, you use similar notation to say:
When the method getFoo() is referred to in a
I want to get an array's length wit VTL, but $mayArray.length doesn't
work. How s it done?
Thanks!
,boz
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Velocity isn't too great at referencing arrays but there is a tool to help
here;
http://wiki.apache.org/jakarta-velocity/ArrayTool
Steve
-Original Message-
From: Christofer 'boz' Jennings [mailto:[EMAIL PROTECTED]
Sent: 18 March 2005 15:07
To: velocity-user@jakarta.apache.org
Subject:
Thanks Steve!
Is there a binary for ArrayTool somewhere or do I just build it?
And how would it get configured programmatically (eg.
velocity.setProperty())?
???
,boz
On Mar 18, 2005, at 7:41 AM, Steve O'Hara wrote:
Velocity isn't too great at referencing arrays but there is a tool to
help
That didn't work for me. Is there a setting to allow it?
,boz
On Mar 18, 2005, at 7:36 AM, Assia Aouat wrote:
Try this :
$mayArray.size()
-Original Message-
From: Steve O'Hara [mailto:[EMAIL PROTECTED]
Sent: Friday, March 18, 2005 10:42 AM
To: Velocity Users List
Subject: RE: reading an
Christofer 'boz' Jennings [EMAIL PROTECTED] wrote:
Is there a binary for ArrayTool somewhere or do I just build it?
And how would it get configured programmatically (eg.
velocity.setProperty())?
It's included with the latest (cvs) Velocity tools, I think.
It's also available on the
Hi,
I also used Array Tool before. However, looking at the source of it,
it appears to me that every time you call a method of the Array tool,
it creates a new instance of the array list internally, which is mild
performance problem.
So, now I tried to avoid using it. What I did is to use
Hi all,
Has anyone implemented a JDBCRealm and MD5 encrypted passwords with a
velocity app? I've got everything working, with one exception. I've got
some admin pages that need a way to encrypt clear text passwords from
an HTML form before storing them in the database.
I've Googled this and
You can't do this in Velocity. Check out the java.security classes.
I'm doing MD4:
import gnu.crypto.jce.GnuCrypto;
import java.security.MessageDigest;
import java.security.Security;
public static byte[] encryptMD4(String s) throws Exception {
Security.addProvider(new GnuCrypto());
Hi Mike,
Is there a binary for ArrayTool somewhere or do I just build it?
It's included with the latest (cvs) Velocity tools, I think.
Not yet. I'm going to get the List support back first.
## svn, BTW ;)
Best regards,
-- Shinobu
--
Shinobu Kawai [EMAIL PROTECTED]
Hi Jian,
I also used Array Tool before. However, looking at the source of it,
it appears to me that every time you call a method of the Array tool,
it creates a new instance of the array list internally, which is mild
performance problem.
The current version uses reflection, so shouldn't be
Hi Andrés,
Hi, i have a sugestion for you to change in the User's guide:
// in section Case Substitution, you make the following example:
$foo.getBar()
## is the same as
$foo.Bar
// ...then in the text below that, you use similar notation to say:
When the method
Hi Elton,
First, I am very new to Velocity. I have installed it and I ran 'ant
test' and it came back successful.
Welcome to Velocity-World and congratulations on a working copy of Velocity! :)
I am learning Velocity by reading
'Pro Jakarta Velocity' by Rob Harrop. In the first example
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 are using $project $name to render this.
When I passed in null for project and velocity for name then the result is
We are using
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
Ahh. Now I get tools So simple :-)
Dummied the ArrayTool down to just what I need. Later it can be swapped
for the real thing I guess. Herre's what I did
//- start snip
package mystuff;
import java.lang.reflect.Array;
public class VelocityArrayTool
{
/**
Christofer 'boz' Jennings [EMAIL PROTECTED] wrote:
Ahh. Now I get tools So simple :-)
Yeah, that's exactly how I felt. It just took me a lot longer to figure it
out.
Wonderfully brilliant yet simple idea once you realize that there's nothing
special about a tool. :)
And its nice to use something that makes me say ahh instead of
argh! :-)
,boz
On Mar 18, 2005, at 6:09 PM, Mike Kienenberger wrote:
Christofer 'boz' Jennings [EMAIL PROTECTED] wrote:
Ahh. Now I get tools So simple :-)
Yeah, that's exactly how I felt. It just took me a lot longer to
21 matches
Mail list logo