On 8/9/07, Ian Dickinson [EMAIL PROTECTED] wrote:
I figured it out. Dumb error on my part, though the error message could
have been a tad more helpful:
ve.evaluate( pvc, sw, null, reader );
The template name must not be null, else
VelocimacroFactory.addVelocimacro barfs.
yeah, i saw that
Velocity doesn't provide access to the current date automatically.
However, the VelocityTools project does have a DateTool which can do
that and much more for you. You can just add an instance of it to the
context.
http://velocity.apache.org/tools/devel/generic/
On 8/9/07, Thomas Foster [EMAIL
This looks cool! This would be a good thing to link to on our Wiki.
Perhaps on http://wiki.apache.org/velocity/ContributedCode
Thanks for sharing!
On 8/7/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hello,
for those interested in velocity and groovy:
I have implemented a simple
You can manually create an instance of DataSourceResourceLoader, set
the DataSource on it directly using the setDataSource() method, and
then directly inject that instance into your VelocityEngine by doing
something like:
DataSourceResourceLoader dsrl = new DataSourceResourceLoader();
that
you need to specify the full, absolute path to your templates in the
file system.
On 8/6/07, nageshyakkanti [EMAIL PROTECTED] wrote:
I am using an exploded war file in this.
Nathan Bubna wrote:
The FileResourceLoader is notoriously difficult to configure property
in a webapp
I would look into something like Spring Web Flow for this. I haven't
used it myself, but i imagine it would likely support Velocity, since
Spring MVC and Spring Email both do.
On 7/27/07, White, Tim [EMAIL PROTECTED] wrote:
Any tips or examples out there for handling multi-step flows with
This can't be done within a template unless you create a tool (a
java class that you put in the context to perform a function rather
than be displayed) with a method that will do this for you.
so make a class like
public BitTool {
public int and(int a, int b) {
return a b;
}
}
put an
You should probably use the WebappLoader in the VelocityTools project.
It has all the perks of the FileResourceLoader, while only requiring
servlet context relative paths. :)
On 7/22/07, Philipp Leusmann [EMAIL PROTECTED] wrote:
Hi,
I am trying to use the ClasspathResourceLoader in my
PROTECTED] wrote:
Thanks for this hint, Nathan.
But why can´t I find anything about the webappLoader in the
Velocity(Tools) documentation?
Regards,
Philipp
Nathan Bubna schrieb:
You should probably use the WebappLoader in the VelocityTools project.
It has all the perks
On 7/19/07, Erron Austin [EMAIL PROTECTED] wrote:
In my webapp I'm initializing Velocity the like this:
Velocity.*init*(props);
However, later in my code I'm trying to update this properties like so:
if(condition){
Velocity.*clearProperty*(file.resource.loader.path);
this issue
(certainly for me, at least) and brought to light the fact that some of the
documentation may have been a little misleading/out of date (which happens).
All the best,
Chris
-Original Message-
From: Nathan Bubna [mailto:[EMAIL PROTECTED]
Sent: 17 July 2007 18:46
To: Velocity
The TilesTool (and it's parent ImportTool) work largely by creating
sub-requests to the files or pages being included. So, if a JSPF
file is being included as plain text, it is likely because the servlet
that handles the request for that file doesn't know to treat *.jspf
files as JSP. Just map
On 7/17/07, Will Glass-Husain [EMAIL PROTECTED] wrote:
Joe/Chris--
I use log4j in some of my apps, haven't had much trouble.
Are you using Velocity 1.5? Velocity's logging behavior was cleaned up
substantially in the last release. The
velocity.log file is generated by the Avalon logkit, it
my guess is that either the getFirstName() method or else the whole
Person class are not declared as public.
Velocity will only give access to public methods in public classes.
On 7/15/07, wong wayne [EMAIL PROTECTED] wrote:
Hi all
I'm using spring with velocity to sending email.
Program
On 7/12/07, Joe Kramer [EMAIL PROTECTED] wrote:
Hello,
I've spent good 10 hours trying to load template in webapp.
First I tried
resource.loader= file
and putting template into any posible directory, WEB-INF, classes,
lib, web app root.
Also tried to use
resource.loader=class
Putting template
On 7/12/07, Joe Kramer [EMAIL PROTECTED] wrote:
On 7/13/07, Nathan Bubna [EMAIL PROTECTED] wrote:
On 7/12/07, Joe Kramer [EMAIL PROTECTED] wrote:
Hello,
I've spent good 10 hours trying to load template in webapp.
First I tried
resource.loader= file
and putting template into any
i don't know of any cons. what you are asking about is what i would
recommend for any app using the VelocityViewServlet (and kin).
On 7/11/07, Robert Koberg [EMAIL PROTECTED] wrote:
Hi,
What are the cons of simply using the (Http)ServletRequest object to
store objects for a view template. Or,
On 7/1/07, Thomas Vandahl [EMAIL PROTECTED] wrote:
Nathan Bubna wrote:
1) the AvalonLogChute class first tries to get its Avalon Logger via
Heirarchy.getDefaultHeirarchy().getLoggerFor(some logger name).
This some logger name is null by default but can be set to a valid
logger name via
On 6/28/07, Peter Locke [EMAIL PROTECTED] wrote:
There are great pages for the velocity engine (links below), is there
something similar for the velocity tools subproject?
Unfortunately, no. We don't have such nice pages for Tools. That'd
be nice though. Would you create a JIRA issue for
i see two possible options that don't involve modifying the current
Velocity code...
1) the AvalonLogChute class first tries to get its Avalon Logger via
Heirarchy.getDefaultHeirarchy().getLoggerFor(some logger name).
This some logger name is null by default but can be set to a valid
logger name
On 6/23/07, sebb [EMAIL PROTECTED] wrote:
On 24/06/07, Nathan Bubna [EMAIL PROTECTED] wrote:
i believe you just need to add a line like this to the texen.properties file:
context.objects.sort=org.apache.velocity.tools.generic.SortTool
Thanks - I looked at that, but the properties file
i believe you just need to add a line like this to the texen.properties file:
context.objects.sort=org.apache.velocity.tools.generic.SortTool
once Tools 2.0 is out, i plan to try and find time to provide better
integration between Tools and Texen/Anakia/DVSL (or examples, where
the current
On 6/18/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote:
Hi Serge,
the escaping of the characters #$' does not work in all cases.
I suggest you try:
#set( $H = '#' )
#set( $D = '$' )
#set( $Q = '' )
#set( $S = ' )
#mymacro( $attribute ${H}include ${Q}${attribute.type.name}.h${Q})
You could
On 6/11/07, Peter Locke [EMAIL PROTECTED] wrote:
I would like to upgrade to velocity 1.5 from 1.4 and take advantage of the
fixes and improvements. I have a few questions:
1) I would like to remove the now deprecated VelocityServlet, however the
size and scope of our webapp and the number of
This is not a Velocity question. Please ask this on the Struts user
list. It is the Struts2 project which developed and maintains the
macros you are asking about.
On 6/11/07, tallurisuresh [EMAIL PROTECTED] wrote:
Hi,
I am using the velocity for UI purpose.when i am developing the velocity
probable, I will probably have to extend the ViewServlet.
Nathan Bubna wrote:
On 6/8/07, Garey [EMAIL PROTECTED] wrote:
Nathan -
I'm using VelocityViewServlet, but this template produces an HTML
form if 'binds' is not defined. Is there a
way to set the content type from inside
no such thing as a RuntimeEngine. ;-)
and yes, you can call it, but no, it won't do anything. totally
useless at that point.
On 6/4/07, White, Tim [EMAIL PROTECTED] wrote:
Can we do a setProperty on a RuntimeEngine after it has been initalized?
Thanks!
Tim
This communication is the
On 5/22/07, Garrett Smith [EMAIL PROTECTED] wrote:
Hi,
Is it possible to invoke a jsp tag from velocity?
not standard. WebWork once had support for this, which became this project:
https://velotags.dev.java.net/
it probably still works, but i haven't tried it.
If not, can I
include a
What is $text? Are you trying to use VelocityTools with Struts2? If
so (and it very much looks like it), what version? What does your
toolbox.xml look like? Are you using the VelocityViewServlet to
process templates or is that something that Struts2 is handling?
VelocityTools currently only
On 5/9/07, Matthew Twomey [EMAIL PROTECTED] wrote:
Greetings,
hi!
I'm new to Velocity and I fear I may be misinterpreting the intent of this
the tools package. What I'd like to do is use the RenderTool.eval function
to process strings with template information in them.
The RenderTool is
#set( $d = '$' )
j:if test=${d}{dep.getProperty('explode') == 'true'}
On 5/9/07, Aaron Zeckoski [EMAIL PROTECTED] wrote:
I am having trouble with velocity not escaping some references in a
maven.xml file which I am processing with velocity.
Here is the offending bit (there are others like
On 5/5/07, Adam Cornett [EMAIL PROTECTED] wrote:
I am implementing Velocity in a website and everything is going
fine...except I can't get it to load templates from inside java code.
are you using one of the servlets we provide (like the VelocityViewServlet)?
For
example, one class e-mails a
On 5/7/07, Sebastian Gumpold [EMAIL PROTECTED] wrote:
Hi all!
Is it possible to use static classes in a Velocity template?
not without some really ugly, in-template reflection hacks.
When using
context.put(bla, instanceOfBla);
a concrete instance of a class is needed, so this of course
On 5/6/07, Thilo Schwarz [EMAIL PROTECTED] wrote:
Hi to all!
It seems, I need a hit on my head. I've got the problem to understand
the pattern to configure the StringResourceRepository! I'm using
velocity in a standalone application. To initialize the
VelocityEngine, I do something like that:
(no timetable on that though).
On 4/25/07, Nathan Bubna [EMAIL PROTECTED] wrote:
Ok, i created an issue myself and took some time today to fix
StringResourceLoader to use repository(s) sanely. I'm still writing
some new tests for it but will check it in soon.
http://issues.apache.org/jira/browse
the steps above.
Regards
Peter lamb
Nathan Bubna wrote:
Did you delete the other VelocityTools stuff in your webapps directory
before trying the latter?
Can you give more information about your Tomcat installation? Is it a
clean install or one you've used for a while? Have you changed any
Status report
message /simple/index.vm
description The requested resource (/simple/index.vm) is not available.
Nathan Bubna wrote:
I just tried the simple example from VelocityTools 1.3 and 1.4-dev
with a fresh download of Tomcat 6.0.10 and had no problems.
Are you copying the whole examples
just to confirm, i get the same error for that macro, and i don't see
anything wrong with it.
i'm also surprised that the template i put the macro in still works,
with the parse exception only showing up in the logs. anyone know why
VelocimacroManager.MacroEntry.parseTree() only logs parse
context, not the path from the root
of the WEB-INF directory.
Velocity initialization:
Velocity.init();
So how can I use WebappLoader to find the template(*.vm)
Thanks in advance for the response
Tejas
-Original Message-
From: Nathan Bubna [mailto:[EMAIL PROTECTED]
Sent: Friday
programmatic configuration of a WebAppContext
(not exactly sure how yet).
I look forward to your further explanation, and to Tools 2.0 as well!
David
On 3/27/07, Nathan Bubna [EMAIL PROTECTED] wrote:
On 3/27/07, David Donohue [EMAIL PROTECTED] wrote:
Sorry if this has been addressed but I have
You don't need the AvalonLogChute. This is a debug level message,
because it is non-essential. It is only for backwards compatibility
that Velocity's Runtime will by default try to use Avalon LogKit
before falling back to other LogChute implementations.
On 3/23/07, Michael Giroux [EMAIL
On 3/23/07, Michael Giroux [EMAIL PROTECTED] wrote:
What platform are you running on (Web container / J2EE container)?
This is an Eclipse plug-in.
Are you running in an EAR / WAR?
No.
If yes, would it be possible to move the
velocity jar out of the modules and into the common lib
if there's a list for eclipse plugin developers, they might be able to
help you more at this point.
On 3/23/07, Nathan Bubna [EMAIL PROTECTED] wrote:
On 3/23/07, Michael Giroux [EMAIL PROTECTED] wrote:
What platform are you running on (Web container / J2EE container)?
This is an Eclipse
On 3/22/07, YourSoft [EMAIL PROTECTED] wrote:
Dear Nathan,
I have only one question:
Which is the main adventage the one VelocityViewServelt
assign to *.vm over the extends VVS?
this isn't really a valid comparison, since you can extend VVS *and*
assign your subclass to *.vm, if you want to
On 3/12/07, Michael Giroux [EMAIL PROTECTED] wrote:
I upgraded to Velocity 1.5 and some of my templates started to fail.
Not sure if this represents an error in my existing templates, an
error in Velocity 1.5, or just one of those things that should be
documented.
From the Velocity 1.5 release
Thanks, Michael!
On 3/12/07, Michael Giroux [EMAIL PROTECTED] wrote:
https://issues.apache.org/jira/browse/VELOCITY-528
On 3/12/07, Nathan Bubna [EMAIL PROTECTED] wrote:
On 3/12/07, Michael Giroux [EMAIL PROTECTED] wrote:
I upgraded to Velocity 1.5 and some of my templates started to fail
Please use the user@velocity.apache.org list for these sorts of
questions. that said, i believe you are looking for these documents:
http://velocity.apache.org/engine/devel/user-guide.html
http://velocity.apache.org/engine/devel/vtl-reference-guide.html
On 3/8/07, Diane Soini [EMAIL PROTECTED]
On 3/7/07, Rodney J Woodruff [EMAIL PROTECTED] wrote:
This probably has been asked a number of times but I can't find the search
for the mailing list archives. So, here goes:
1. Can someone tell me where the search for the mailing list archives are?
User List
This is either the first time i've heard a proposal like this, or else
those who've made such suggestions have not been persistent in them.
If you would like this to be remembered, i'd recommend adding it to
the Wiki page for the whitespace issue:
like just calling
Velocity.init() is not enough.
-Original Message-
From: Nathan Bubna [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 07, 2007 5:53 PM
To: Velocity Users List
Subject: Re: Velocity template file path
On 3/7/07, George, Nixon [EMAIL PROTECTED] wrote:
I am using
- What servlet are you using? The VelocityServlet (which is
deprecated) or the VelocityViewServlet (which is part of VelocityTools
and is the replacement for the VelocityServlet)?
- Use of the FileResourceLoader in a webapp environment is not
recommended. The VelocityTools project comes with a
? Thanks.
if you are using the VelocityViewServlet, it uses it by default.
javadoc is here:
http://velocity.apache.org/tools/releases/1.3/javadoc/org/apache/velocity/tools/view/servlet/WebappLoader.html
-Original Message-
From: Nathan Bubna [mailto:[EMAIL PROTECTED]
Sent: Wednesday
yeah, getKeys() tells you what is available to the template, not what
the template is looking for. To do that, you have to process the
template itself. You could use this:
http://svn.apache.org/repos/asf/velocity/engine/trunk/experimental/templatetool/
On 3/6/07, Dave, Tejas [EMAIL PROTECTED]
On 3/5/07, Steven Shaw [EMAIL PROTECTED] wrote:
Is there any way to split a long line?
e.g.
# macro (aVeryLongMacroName $aVeryLongParameterName1
$aVeryLongParameterName2 $aVeryLongParameterName3
$VeryLongParameterName4)
I tried \ at the end of the line but that wasn't it.
If you use the
Yes and no. Even if we fix the known issue, that won't necessarily
mean that a session will be created. The VelocityViewServlet is not
going to go creating sessions without some cause; i'll never let it do
that. However, if there tools declared to be session-scoped in the
toolbox.xml, then it
You might consider searching the archives of the jboss-user list or
asking them directly. This doesn't appear to be an issue with
Velocity specifically, but rather about how Jboss handles
jars/classpaths.
On 2/27/07, Harish Hirasave [EMAIL PROTECTED] wrote:
I tried Velocity 1.5 beta but it did
comments. I made the changes but I'm still getting the same
error when $msg.label.portal.welcome gets executed. It's like for some
reason Velocity can't see the Struts ApplicationResource file and can't find
the message.
Any body see what's missing here?
Thanks
Nathan Bubna wrote:
On 2/20/07
,
Michael
On 2/20/07, Nathan Bubna [EMAIL PROTECTED] wrote:
I imagine you could get pretty far by wrapping the RubyObjects in a
more Velocity-friendly object that takes advantage how Velocity treats
get(String) methods before putting it into the context.
Perhaps something like:
public class
together, how does one set a new
Uberspector into Velocity?
On 2/20/07, Will Glass-Husain [EMAIL PROTECTED] wrote:
I like the Uberspector idea. Nice and generic. Cleanly provides a
bridge between Velocity and Ruby syntax.
On 2/20/07, Nathan Bubna [EMAIL PROTECTED] wrote:
Oh, and the other
I'd recommend keeping all your jars in the application lib to begin
with. That said, what jars are you using? Also, have you tried
running one of the example app's that came with the velocity-tools-1.2
distribution? If you look in WEB-INF/lib directory of those WARs, you
should find the jars
this, i'd definitely consider
them.
Thanks!
-Travis
On Mon, 2007-01-29 at 13:18 -0800, Nathan Bubna wrote:
The release downloads have moved since 1.2, so the documentation with
that release is out of date. Downloads can now be found here:
http://velocity.apache.org/download.cgi
Please
The Apache Velocity project is pleased to announce the first release
candidate for VelocityTools 1.3. You may download this release from:
http://velocity.apache.org/download.cgi
Significant changes since VelocityTools 1.2 are:
- New tools: ContextTool for accessing context data, ResourceTool
what versions of VelocityTools and Digester are you using?
On 1/29/07, Travis Bear [EMAIL PROTECTED] wrote:
Hi All!
I'm having a problem with the Velocity Layout Servlet failing to load
the toolbox when a certain tool is configured in. From the sound of it,
it would seem like this would be a
Even if you don't make a patch, putting it in JIRA will help us
remember the idea. :)
On 1/27/07, Steve O'Hara [EMAIL PROTECTED] wrote:
I couldn't see it on JIRA so I'd thought I'd ask here.
I would like to be able to overload macros i.e. same name, different
number/type of parameters.
I will
On 12/14/06, Tod Thomas [EMAIL PROTECTED] wrote:
Nathan Bubna wrote:
and what does your web.xml have?
Sorry, plain vanilla:
!-- Define Velocity template compiler --
servlet
servlet-namevelocity/servlet-name
servlet-class
messages to the same
place, regardless of which servlet container you are using.
In short, the Tomcat people did what Geir could not and successfully
convinced me that it is a very bad idea to use commons-logging in a
webapp framework.
Claude
Le jeudi 14 décembre 2006 à 12:30 -0800, Nathan Bubna
If you don't need a specific object type and are using Velocity 1.5,
you can just use the new map syntax to create a map that you can add
properties to.
#set( $personnelRecord = { 'name' : ..., 'rank' : ...,
'serialNumber' : ... } )
if you need to create a specific object, i'd recommend
On 12/6/06, Martin Tilsted [EMAIL PROTECTED] wrote:
Citat Will Glass-Husain [EMAIL PROTECTED]:
Martin,
If at all possible, use VelocityViewServlet from the Velocity Tools
project. Although it works similarly It's better supported. (we've
deprecated VelocityServlet in the latest release).
Actually, the resource loader is the issue. The
ClasspathResourceLoader is not as full featured as the
FileResourceLoader or the WebappLoader (from VelocityTools).
Specifically, it doesn't have functional implementations of
isSourceModified() or getLastModified(), these always return false and
0
501 - 569 of 569 matches
Mail list logo