-1

I used the include tag in a JSP file for a kind of mini template. I put the generalized parts in seperated text files and included them in my special JSPs. This is very slow on loading. Now I want to include this parts via velocity on the build process.

I learned that velocity has a "parse" and "include" command. But how could I define a ant task for velocity so that these commands are used by velocity to generated my new JSPs? I don't find any examples for using velocity in such a simple way with ant.

Maybe there is an alternative to velocity.

Thank you very much!

Vivid

Vivid
  • 399
  • 1
  • 8
  • 19

1 Answers1

1

JSP includes are slow on loading only for the first time - they need to be compiled. They should not be slow on the subsequent requests. If it is slow on subsequent requests, then you are most likely using wrong include: What's the difference between including files with JSP include directive, JSP include action and using JSP Tag Files?

If you want to speed up the initial access, you should precompile JSPs: What is the best way to precompile JSPs using Ant

Velocity is a generic templating system but it does not suit your case. Velocity could be used instead of JSPs, supports includes and initial loading is way faster than JSP compilation.

Community
  • 1
  • 1
Vilmantas Baranauskas
  • 6,596
  • 3
  • 38
  • 50