#set($variavel1 = " Primeira String ")
#set($variavel1 = $variavel1 + " Segunda String ")
$variavel1
Segunda
#set($variavel1 = " Primeira String ")
#set($variavel2 = " Segunda String ")
#set($variavel3 = $variavel1 + $variavel2)
$variavel3
acusam o seguinte erro:
[quote]2004-11-12 10:15:25,198 INFO [org.jboss.web.localhost.Engine] StandardContext[/mysite] Velocity [error] Left side of addition operation is not a valid type. Currently only integers (1,2,3…) and Integer type is supported. gestao/documentacao.vm [line 70, column 31]
será que pode ser coisa de configuração do velociy?
Não sei se estou inventando moda, às vezes pode ser resolvido de outra forma, é que o caso que tenho existem duas variaveis de array uma com nomes de parametros e outra com valores, preciso concatenar pra ficar algo tipo
Segui tua orientação, é algum enigma ? não entendi :oops: , olha só onde caiu:
[quote]template is a VM at parsetime, #parse()-ing a set of VM declarations won’t work as expected. To get around this, simply use the velocimacro.library facility to have Velocity load your VMs at startup.
What is Velocimacro Autoreloading?
There is a property, meant to be used in development, not production :
velocimacro.library.autoreload
which defaults to false. When set to true along with
<type>.resource.loader.cache = false
(where <type> is the name of the resource loader that you are using, such as ‘file’) then the Velocity engine will automatically reload changes to your Velocimacro library files when you make them, so you do not have to dump the servlet engine (or application) or do other tricks to have your Velocimacros reloaded.
Here is what a simple set of configuration properties would look like.