You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Michael Stanley <ms...@twcny.rr.com> on 2001/03/20 07:31:51 UTC

velocity.properties file

Can someone send me an example velocity.properties file?  I'm interested
in finding out different configuration techniques people use with
velocity.  I'm also looking to see how someone has implemented a
velocity site that deals with more than one template path.

Thanks
Mike

Re: velocity.properties file

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Michael Stanley wrote:
> 
> Can someone send me an example velocity.properties file?  I'm interested
> in finding out different configuration techniques people use with
> velocity.  I'm also looking to see how someone has implemented a
> velocity site that deals with more than one template path.

Check in the developer guide 

http://jakarta.apache.org/velocity/developer-guide.html

for a complete discussion of all properties, and look in the examples
directory for examples that use a properties file.

There are a couple of techniques for multiple template paths.  You can
either use the FileResourceLoader and specify multiple paths, such as

resource.loader = file

file.resource.loader.description = Velocity File Resource Loader
file.resource.loader.class =
org.apache.velocity.runtime.resource.loader.FileResourceLoader
file.resource.loader.path = <directory1>,<directory2>,<directory3>
file.resource.loader.cache = false
file.resource.loader.modificationCheckInterval = 2

Note you could just get away with specifying

file.resource.loader.path = <directory1>,<directory2>,<directory3>

as the other values are the defaults

The other way is to load your templates into jars, and use the
ClasspathResourceLoader - if running in a 2.2 or better servlet
container (Tomcat 3.2 or better), you can then just drop the jars into
WEB-INF/lib and velocity will find them - just specify

resource.loader = class
class.resource.loader.class =
org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader

in your properties file for your servlet (see dev doc)

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

Re: Other symbol then "#" ?

Posted by Roall Lein-Killi <ro...@griffel.no>.
On Tuesday 20 March 2001 09:39, you wrote:
> Can someone tell me how I can configure Velocity to use another start and
> end VTL symbol, which is now "#" ?
> I like to use "<!--#" such that the web browser sees it as comments when
> only the templates are viewed.
>
> Regards,
> Ed Bras

why not write:

<table>
<!--
#foreach($item in $list)
-->
   <tr>
      <td>
         $item.getName()
      </td>
   </tr>
<!--
#end
-->
</table>

It's not 100% but is as close as you get.
An another + with this method is that it's more pretty if you 
indent VLT and HTML different. (whitch you often must).

killi

-- 
Penguins are nice animals -
if you get to know them!

Re: Other symbol then "#" ?

Posted by "Geir Magnusson Jr." <ge...@optonline.net>.
Eddie wrote:
> 
> Can someone tell me how I can configure Velocity to use another start and
> end VTL symbol, which is now "#" ?
> I like to use "<!--#" such that the web browser sees it as comments when
> only the templates are viewed.

You cannot change the symbol to start a directive, but I thought that 
killi's solution was nice 

> <table>
> <!--
> #foreach($item in $list)
> -->
>    <tr>
>       <td>
>          $item.getName()
>       </td>
>    </tr>
> <!--
> #end
> -->
> </table>

geir

-- 
Geir Magnusson Jr.                               geirm@optonline.net
Developing for the web?  See http://jakarta.apache.org/velocity/

<-- Moron

Posted by Frank Martini <fm...@caddev.com>.
Ok guy, I hate to send this moronic message to the group-- but I swear I've
tried using the instructions on the web page..... please help me unsubscribe
:-(

Frank


Other symbol then "#" ?

Posted by Eddie <po...@hotmail.com>.
Can someone tell me how I can configure Velocity to use another start and
end VTL symbol, which is now "#" ?
I like to use "<!--#" such that the web browser sees it as comments when
only the templates are viewed.

Regards,
Ed Bras