Hello,

See below ...

Cameron Braid wrote:

Oh.. another thing.. is it possible to find templates that are specified
using a relative path, relative to the jsp that uses them ?

i.e.

/WEB-INF/views/test.jsp

<ww:component template="test.vm"/>

/WEB-INF/views/test.vm

hello from test.vm

Can this work, allowing both test.jsp and test.vm to be moved 'anywhere' and
this component tag still be able to load the vm ?

With Velocity, there's no such concept as a relative template. Templates are always located based on a full path to the appropriate resource loader. So although the ww:component tag could create the appropriate prefix to allowing call a Velocity template in a relative manner, any template in test.vm that calls #include or #parse will fail unless it contains a full path.


In Velocity-land there have been one or two proposals to fix #include and #parse so they are relative. Don't know if either of these will get checked in.

In the meantime, the ww:component tag could set the template prefix into the VelocityContext that it prepended to the template. When calling #include or #parse in a template, the prefix variable would have to be specified, i.e.:
#parse("$template_prefix/test_include.vm")


-Bill




------------------------------------------------------- This SF.net email is sponsored by: eBay Get office equipment for less on eBay! http://adfarm.mediaplex.com/ad/ck/711-11697-6916-5 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to