here my 2c:
1) What do we do about determining if a reference is null in VTL?
[snip]
- use something like : #if( $foo == null )
+0, but make it uppercase NULL to reflect the constantness of it.
[snip]
- or #ifdefined( $foo ) or #ifdef( $foo )
This is trivially easy to do.
but not
utsches Fernerkundungs Datenzentrum (DFD)
DLR-DFD, Muenchner Strasse 20, D-82234 Wessling, Germany
= Currenlty relocated to ESA-ESRIN ===
ESA ESRIN Tel: +39 06 941 80 589
c/o Christoph Reck (DLR) Fax: +39 06 941 80 512
Via Galileo Galilei
The problem is probably that you used frames, and the frame the field
is in does not have focus. Put the focus on the frame first using:
window.focus();
I had the same problem and after I found this, the following code
works (in a JavaScript block):
// set focus either on password or
Please see the simple specification and examples at
ftp://ftp.dfd.dlr.de/put/reck/XML_Configuration.html
The sources are at
ftp://ftp.dfd.dlr.de/put/reck/XmlConfig
Please let me know if it is desireable that I prepare this for
submission to the apache commons.
:) Chirstoph
Magnus
.
So, an admittedly cosmetic improvement would be to figure out how to grab those
subproject
names if they were child tag values, as I described above. I guess this is an xpath
question.
--
:) Christoph Reck
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail
=javascript:closeWindow()\n' +
' img src=$buttontext=Close+Window\n' +
' name=submit alt=Close Window border=0/a\n' +
'/center\n' +
'\n';\n' +
document.open();
document.write(html);
// --
/SCRIPT
--
:) Christoph Reck
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED
$Regexp.substitute('s/ /nbsp;nbsp;/g', $l_line)/ttbr$NL#*
*##end#*
*#br$NL#*
*##end
--
:) Christoph Reck
--
To unsubscribe, e-mail: mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]
();
Thanks for this tip.
Does this also apply to the standard VelocityEngine?
geir
--
:) Christoph Reck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
one should be
simple.
--
:) Christoph Reck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
:) Christoph Reck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
]
For additional commands, e-mail: [EMAIL PROTECTED]
--
:) Christoph Reck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
who understand binary and those who don't.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
:) Christoph Reck
Hi,
there is a RenderTool in the velocity tools subproject that you can
reuse to do the Velocity.evalute(...) for you.
Cheers,
Christoph
Kris Nuttycombe wrote:
So, just to clarify, the tool I put into the context will invoke
Velocity.evaluate(...) on the string containing the new macro? And I'll
Ben wrote:
Where can I find more information about Velocity Directive? I would
like to write one but so far it doesn't work...
I would like to do something like this:
#useSomething(/WEB-INF/file.xml)
#doSomething(nodeA)
#doSomething(nodeB)
#end
I created two directives, one for #useSomething (as
Hi Yim,
to my knowledge, you can tell the obfuscator to not touch
specific classes/classNames/methods, which are part of
the external API.
Velicity uses java objects placed in the context under a
specific keyName, which are then accessed in the template
with the $keyName as a reference. $keyName
it, probably it is the best
to do it yourself as noted. Be warned, it won't be an easy task.
If you find trouble with searializing the velocity classes, you
might try to fix it and send patches or seek advice in the
velocity-dev list.
Carfield Yim wrote:
Christoph Reck wrote:
Hi Yim,
[snip]
You seem
the VelocitylayoutServlet, wher you have to instruct to skip the
layout in such a case...
If you wish an example of creating binary content with a servlet
check the literature, servlets.com, or I can send you a servlet code
that creates button+text images on the fly.
--
:) Christoph Reck
. That code would be much appreciated. Could you also
tell me to which directory I should compile my .class to?
Ilan
-Original Message-
From: Christoph Reck [mailto:[EMAIL PROTECTED]
Sent: 25 November 2004 04:17
To: Velocity Users List
Subject: Re: vm to return a binary file
Ilan Azbel wrote
the VelocitylayoutServlet, wher you have to instruct to skip the
layout in such a case...
If you wish an example of creating binary content with a servlet
check the literature, servlets.com, or I can send you a servlet code
that creates button+text images on the fly.
--
:) Christoph Reck
Hi Rob, (and everyone else trying to understand velocitys whitespace handling...
Check the Wiki page
http://wiki.apache.org/jakarta-velocity/VelocityWhitespaceGobbling
on this subject. The so called VelocityWhitespaceGobbleChristophsWay
should be called
PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
:) Christoph Reck
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
1rst: reconsider your design; your example causes a infinite depth
call tree and will end up in an OutOfMemoryException... Velocity
has some guards in recursive parses (property: directive.parse.maxdepth = 10),
but it does not look like it guards against deep macro calls.
2nd: You could
on the line of this thread...
Sometimes I use the #*...*# spanning a line to allow for structured
templates; also some macros help making the implicit formatting visible:
##
#macro( print $text )$text#end
##
#macro( println $text )$text
#end
##
#macro( testMacro )#*
*##if ( some condition )#*
Hi,
I remember having problems with the introspector when accessing
static methods of a class itself. But somehow I cannot believe
that it is causing problems when the class was instantiated.
If you tested removing the static from the getter, and it still
does not work:
public String
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 =
that there might be other solutions,
you can re-ask on this thread.
Cheers,
:) Christoph Reck
Michael Belz wrote:
Hi,
I'm trying to put a graphic into an Velocity Template (vm).
The problem is that the servelt generated graphic should not be
physically saved to an temporary folder on the server. It's
that there might be other solutions,
you can re-ask on this thread.
Cheers,
:) Christoph Reck
Michael Belz wrote:
Hi,
I'm trying to put a graphic into an Velocity Template (vm).
The problem is that the servelt generated graphic should not be
physically saved to an temporary folder on the server. It's
Hi,
have you tried the Integer class methods:
## create an integer instance to be used as a tool
#set( $Integer = 0 )
##...
## retrieve your number string
#set( $countString = $!data.getRequest().getParameter(countRow) )
## convert it to an Integer
#set( $count = $Integer.parseInt($countString) )
.
OTOH, some folks would consider it breaking MVC philosofy to use
such code in templates.
:) Christoph Reck
The isA method works, but (at the moment) only checks the actual
classname (not superclasses). Before I go about working this out, I just
wondered if I had missed something crucial ... ?
Cheers
/ViewRenderTool.html
Best regards,
-- Shinobu
Best regards from me too,
:) Christoph Reck
Matthias Wessendorf wrote:
Hi,
I am testing Velocity and I have some templates on file.
That works fine.
However is there a possibility to use a *stream*
something like a String ?
getTemplate(Hello $name! Welcome to Velocity
The reson for not allowing a null in the context was the original
implementation with a Hashtable backed context, which did not allow
nulls. The original designers thought that other implementations
should also be shielded from dealing with null values, eg. databases
(also CORBA) often can't.
Now
to simply create your input file
with ISO-8859-7, use Velocity.getTemplate(template file name, ISO-8859-7)
and then write the output in UTF-8 and have the proper first line
?xml version=1.0 encoding=UTF-8 ? in the FOP file.
Cheers,
:) Christoph Reck
Sandeep kamath wrote:
Hi Daniel,
I am using
See the APIdoc for the String and java.util.regex.Pattern classes
for more information.
Cheers,
:) Christoph Reck
Liu, Teh P wrote:
Hi All,
I have a string TehpaoLiu
Is it possible to just extract Tehpao from the above string in velocity?
Any help will be appreciated.
Thanks
- tehpao
Allnoch Gerlinde wrote:
Hello,
i am looking for something like:
#set ($thema = ereg_replace('# ', '', $thema))
#set ($thema = ereg_replace('# ', '', $thema))
#set ($thema = ereg_replace('#', '', $thema))
How is it possible to do this ?
If you are running on a JDK 1.4 VM try:
#set(
(tm) in the nichglty builds?
:) Christoph Reck
Jean Francois Chamard wrote:
Hi there,
been using velocity for a while now. Is there a way to get out of a
loop?
Perhaps it has been asked but I found nothing on the subject (guide,
wiki, ...).
If there is, sorry about it.
Is there a way to do
Look at the readme.txt of the contributed Local directive in:
http://svn.apache.org/repos/asf/jakarta/velocity/core/trunk/contrib/temporary/localdirective/
:) Christoph Reck
Antonius Ng wrote:
Hi all,
I would appreciate if anyone can advise me on how to declare a local
variable in macro
Checkout the IteratorTool which should address your request:
http://jakarta.apache.org/velocity/tools/generic/
:) Christoph Reck
Jean Francois Chamard wrote:
Christoph's simplest solution works perfectly :)
but if you want to separate each column with , and the last one with
and... here
The simplest solution is to prefix the comma:
#set( $sep = )
#foreach ($column in $column-detail-data)
$sep${column.getChild(header).Text}
#set( $sep = , )
#end
This is fully independant of any counter and end of array.
:) Christoph Reck
Minor, Vitali wrote:
Hallo
= href=javascript:tab('a1','a2','a3') )
might work with a nightly build...
:) Christoph Reck
Shailendra Kumar Vikas wrote:
Hi All,
I am trying to generate some HTML code from the velocity code . I need
to build the HTML syntax and keep it in a string . I want to have a
syntax like
Hi Steve,
Steve O'Hara wrote:
A while back I chastised someone for not using proper String comparison
operators in their templates. I looked in the Velocity code and sure
enough == operators are translated into equals. So I was looking a bit
stupid.
Somebody challenged me to come up with a
Ugh... this is a really complete example on how to hack a system
if you have control of the velocity templates...
To get it to work, you might insert some text outputs for debuging.
I a project with the young velocity 1.0 I did something similar
using a class with a parameterless constructor,
Hi,
Ravikanth L wrote:
Hi All,
I would like to know the valid characters that we can use for a value in
VTL. I tried the following
#set($var = My string with special chars##)
Velocity defines a line-comment starting with the characters ##
Also note that Velocity offers a feature called
Hi Ravikanth,
there is no such list of unallowed characthers in a string. Only the
velocity syntax exists. Therefore up to Velocity 1.4, a string may not
contain the quote character itself and a new-line character.
Additionally you need care with the other symbols: \ $ #
which have a meaning to
Hi,
Daniel Brownell wrote:
Hi there,
Thanks for the help on the Map of maps question. This question is
related.
Velocity is giving me values when I should be getting null.
that is the current standard behaviour of #set, where
it won't change the value when trying to set a null.
In the
Hi,
the whitespace issue has been debated quite a lot, and we have a
consensus in this list that we will implement in the future a
gobble-none and a gobble-structured form; latter, with your
example:
## example of all whitespace being gobbled
#if ($user.isAuthorized)
#text(Hello)
#else
community, and anyone who is interested can jump in
and supply a patch.
Personally, if someone reworks the parser to be non-whitespace-gobbling,
I would be eager to then provide the structured template gobbling
implementation patch!
:) Christoph Reck
Jonathan Revusky wrote:
Christoph Reck wrote
If you want to be flexible in generating PDF or PostScript, you
might want to consider using FOP:
http://xml.apache.org/fop/
Especially
http://xmlgraphics.apache.org/fop/trunk/running.html
And the specification at
http://www.w3.org/TR/xsl/slice6.html#fo-section
Otherwise you can generate
47 matches
Mail list logo