velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "E.R. van Es" <e...@cdls.nl>
Subject macro / parse problem on first run
Date Wed, 06 Jul 2005 11:09:03 GMT
Hello,

  I use JBoss-4.0.1sp1 server, my application uses velocity-1.3.1.  I use velocity to create
the html pages, and have the following two templates:
(note: I simplified the code somewhat...)

------- macro.vm --------
#macro ( test $nr )
	$nr
#end
-------- end macro.vm -------

------- index.vm ---------
#parse("macro.vm")
<html>
	<body>
#test(1)
#test(2)
	</body>
</html>
------ end index.vm -----

Now I deploy this application on JBoss and open the index page through the servlet.  The very
first time I open the page, I get this output:
--- output ----
#test(1)
#test(2)
--- end output ---

now when I refresh the page, I get:
--- output ---
1
2
--- output ---

so the first time it won't execute the macro...?  This only happens the first time opening
the page after a new deployement.  When I copy the whole macro into the index.vm file it works,
also the first time after deployement, but I need the macro in more files, so I want the macro
in a seperate file.

Looking forward to any reply,
Eric

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


Mime
View raw message