You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by ZEESHAN <ze...@gmail.com> on 2008/01/02 06:35:40 UTC
Template Internationalization issue.
Which way i can specify the velocity configuration file pathnames to each
velocity instance , and does it depends on my environment ??.
--
Re: Velocity evaluation with null
Posted by csanders <cs...@hoovers.com>.
Yea thats what Id like to avoid, we have a lot of third party code that
returns null to mean 'empty' that we want to have as blank.
On Thu, 2008-01-03 at 17:05 -0500, Michael Yartsev wrote:
> You could do something like (might be ugly but it would work)
>
> #if($myObject.getSomethingThatMightBeNull() == null)
> ##output your empty string here
> #else
> $myObject.getSomethingThatMightBeNull()
> #end
>
> 2008/1/3, csanders <cs...@hoovers.com>:
> >
> > Currently when something evaluates to null it just shows the literal
> > text, like $myObject.getSomethingThatMightBeNull() .
> >
> > Is there to tell velocity to spit out an empty string instead of leaving
> > it in the HTML ?
> >
> > Thanks,
> > Charlie
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Velocity evaluation with null
Posted by Michael Yartsev <an...@gmail.com>.
You could do something like (might be ugly but it would work)
#if($myObject.getSomethingThatMightBeNull() == null)
##output your empty string here
#else
$myObject.getSomethingThatMightBeNull()
#end
2008/1/3, csanders <cs...@hoovers.com>:
>
> Currently when something evaluates to null it just shows the literal
> text, like $myObject.getSomethingThatMightBeNull() .
>
> Is there to tell velocity to spit out an empty string instead of leaving
> it in the HTML ?
>
> Thanks,
> Charlie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
Re: Velocity evaluation with null
Posted by csanders <cs...@hoovers.com>.
Ahh thanks Nathan!
I will look at extending ContextTool also.
On Thu, 2008-01-03 at 14:40 -0800, Nathan Bubna wrote:
> Use quiet notation:
>
> $!myObject.getSomethingThatMightBeNull()
>
> On Jan 3, 2008 1:48 PM, csanders <cs...@hoovers.com> wrote:
> > Currently when something evaluates to null it just shows the literal
> > text, like $myObject.getSomethingThatMightBeNull() .
> >
> > Is there to tell velocity to spit out an empty string instead of leaving
> > it in the HTML ?
> >
> > Thanks,
> > Charlie
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> > For additional commands, e-mail: user-help@velocity.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Velocity evaluation with null
Posted by Nathan Bubna <nb...@gmail.com>.
Use quiet notation:
$!myObject.getSomethingThatMightBeNull()
On Jan 3, 2008 1:48 PM, csanders <cs...@hoovers.com> wrote:
> Currently when something evaluates to null it just shows the literal
> text, like $myObject.getSomethingThatMightBeNull() .
>
> Is there to tell velocity to spit out an empty string instead of leaving
> it in the HTML ?
>
> Thanks,
> Charlie
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
> For additional commands, e-mail: user-help@velocity.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Velocity evaluation with null
Posted by csanders <cs...@hoovers.com>.
Currently when something evaluates to null it just shows the literal
text, like $myObject.getSomethingThatMightBeNull() .
Is there to tell velocity to spit out an empty string instead of leaving
it in the HTML ?
Thanks,
Charlie
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org
Re: Template Internationalization issue.
Posted by Claude Brisson <cl...@renegat.net>.
I'm sorry I haven't be clear enough. By "environment", I only meant the
way you are using Velocity: within a standalone java application or
inside a web framework of any kind.
If you are using Velocity from a standalone java application, then have
a look at the javadoc for the VelocityEngine class:
http://velocity.apache.org/engine/releases/velocity-1.5/apidocs/index.html
If you are using VelocityTools, then check the javadoc for the
VelocityViewServlet class:
http://velocity.apache.org/tools/releases/1.4/javadoc/index.html
If you are using Velocity within another third party framework, then
please refer to its documentation.
Claude
Le mercredi 02 janvier 2008 à 11:35 +0600, ZEESHAN a écrit :
> Which way i can specify the velocity configuration file pathnames to each
> velocity instance , and does it depends on my environment ??.
>
> --
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org