Velocity: is it better to use the Velocity Macro macro or #include (...) for a DIV block that is repeated multiple times on different pages?

I have about 10 building blocks of dynamically generated HTML that fall into a large percentage of the pages on my site (informational sidebars).

I can use the #include statements or define them as macros, both will work.

What's better? I am new to Velocity and am moving the site with JSP.

Why use one against the other? Why is #include when no-arg macro () does the same? Are they handled differently in terms of caching / memory?

+5
source share
1 answer

( VTL), # , , . ( VTL-), #parse #include - , . , , #define VTL , , . , .

#parse #include , , . #define , / , # define'd , , - .

, , . , . , , .

+6

All Articles