Menu

Using DisplayTag with Velocity template (vm)

tahasc
2007-02-28
2012-10-09
  • tahasc

    tahasc - 2007-02-28

    Hi all,

    Is it possible to use display tag 1.1 on Velocity's template file (*.vm) ?
    If it's not possible, any other way to make this possible ?

    Thanks

     
    • Eric Lentz

      Eric Lentz - 2007-02-28

      Displaytag's most popular mode of operation would be as a taglib on a JSP. You'd want to get the contents of the template into a JSP where it could be subsequently acted upon. I haven't tried it, but you could probably use the jsp:include on the output from writing a template to a temporary location. jsp:include, according to my documentation, indicates that it reads on request (as apposed to the include directive which does it only once). There would be a cost involved as the page would be compiled each time. It wouldn't be very efficient.

      If you are more adventurous you could explore the HtmlTableWriter in displaytag, which takes a JspWriter which extends java.io.Writer, the same class that a vm template.merge requires. You'd be digging pretty deep into displaytag to do that though.

       

Log in to post a comment.