velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neal Smith" <>
Subject Struts and I18N
Date Wed, 24 Aug 2005 18:50:31 GMT
Hi All,

  I am new to Velocity and am working on part of our application written by someone else.

  The app is using Velocity to generate emails.  Currently, we have templates that have hardcoded
English text in them.  I am trying to I18N these templates so that they pick up text from
our .properties files.

  I believe I don't have things setup correctly, but I can't seem to find a "full" example
that explains everything end-to-end, so I can't figure out how to verify this.  From Googling,
I see that lots of people seem to have similar problems, but none of their solutions seem
to work for me.  I think it's involved with how we use the templates, but I'm too new to know
for sure.

  I have dl'd the 1.1 Tools.  I have only copied the velocity-tools-1.1.jar to my lib directory,
because it didn't seem like I needed the rest of it and I already have Struts.  (Am I wrong?)
 I have setup the web.xml and toolbox.xml just like the Velocity website says.  I have updated
part of the template with the following line:

  <title>$msg.get("app.title.txt") - Alert Details</title>



  When I run this I get:

2:4:43 WARN  lang org.apache.velocity.runtime.exception.ReferenceException: refe
rence : template = /com/sas/aml/velocity/email/alert_details.vm [line 5,column 1
0] : $msg.get("app.title.txt") is not a valid reference.


  The real interesting part, to me anyway, is that we are not accessing these templates through
regular Struts forwards, etc.  From what I understand VelocityViewServlet is necessary to
use the MessageTool?  We are using VelocityEngine (via mergeTemplate) and I believe that I'll
need to replace this with usage of VelocityViewServlet?  

  As you can tell, I'm getting very fuzzy on all of this last part.  Any help is appreciated.

Neal Smith

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message