You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Sriram S <ss...@gmail.com> on 2005/06/06 17:11:54 UTC

Doubt regarding concatenation of strings

Hi,

In our project we are using velocity to generate dynamic HTML output. In the 
vm file I wrote a statement: 

 *$literals.safeGet("PL_$data.safeGet("STMT.${count}.FISC_IND")")*

* *

In this statement, I am trying to get values like: *
$literals.safeGet("PL_VALUE")* where VALUE has to be got from *
$data.safeGet("STMT.${count}.FISC_IND")*. When I merge the
output,*ParseErrorException
* is being thrown. 

 It would be really helpful if someone could please tell me why this 
statement is wrong.

 Thanks and Regards,

Sriram.

Re: Doubt regarding concatenation of strings

Posted by Simon Christian <si...@stoutstick.com>.
Hi Sriram,

Well, look at your quotes...not sure there'll be many (any?) languages
out there where that would be legal!

It seems like it should work fine if you break up the two function
calls, i.e.:

#set( $val = $data.safeGet("STMT.${count}.FISC_IND") )
$literals.safeGet("PL_$val" )


- simon


Sriram S wrote:
> Hi,
> 
> In our project we are using velocity to generate dynamic HTML output. In the 
> vm file I wrote a statement: 
> 
>  *$literals.safeGet("PL_$data.safeGet("STMT.${count}.FISC_IND")")*
> 
> * *
> 
> In this statement, I am trying to get values like: *
> $literals.safeGet("PL_VALUE")* where VALUE has to be got from *
> $data.safeGet("STMT.${count}.FISC_IND")*. When I merge the
> output,*ParseErrorException
> * is being thrown. 
> 
>  It would be really helpful if someone could please tell me why this 
> statement is wrong.
> 
>  Thanks and Regards,
> 
> Sriram.
> 

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