velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andyandy <lacaraque...@yahoo.com>
Subject Re: problem parsing references in Velocity
Date Wed, 11 Jun 2008 21:33:16 GMT

I need to send some data to an external service that interacts with my
application. It's just a group of ids and values that the service needs. The
real code that I have is:

#set
($query="id_maq=escape($!{idMaq})&referer=escape($!{referer})&urlv=escape($!{urlv})&urlf=escape($!{idMaq}$!{url})&serv=escape($!{serv})")

The problem is that when any of the variables is null it tries to
"escape(null)", which I don't want. I only want to escape the values that I
do have.







Christopher Schultz-2 wrote:
> 
> andyandy,
> 
> andyandy wrote:
>> Hello. I want to do the following:
>> 
>> #if ($a!="")
>>  #set "${all}escape(${a})"
>> #end
>> #if ($b!="")
>>  #set "${all}escape(${b})"
>> #end
>> #if ($c!="")
>>  #set "${all}escape(${c})"
>> #end
>> 
>> $all
> 
> Can you give some sample data and expected output? I'm not entirely sure 
> what you want to accomplish, here.
> 
> -chris
> 
> 
>  
> 

-- 
View this message in context: http://www.nabble.com/problem-parsing-references-in-Velocity-tp17741235p17787746.html
Sent from the Velocity - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org


Mime
View raw message