Sesat > Docs + Support > Debugging > Debugging Velocity Templates

Example on how to set up velocity debug and local editing of files:
(Debug can always be switched on/off by accessing http://localhost:8080/servlet/VelocityDebug)

Issues: Be sure to specify file.encoding: Export JAVA_OPTS=-Dfile.encoding=utf-8

The velocity debug loader takes the following arguments:

-DVELOCITY_DEBUG=true|false Enable velocity debug(disabling cache etc), default is false. (required)
-DVELOCITY_DEBUG_ON=true|false Show debug by default, default is false.
-DVELOCITY_DEBUG_STYLE=standard|onmouseover|silent
standard is full debug showing every template parsed empty or not
onmouseover shows templates when holding mouse over the different templates
silent shows only filename and editable in the div title.
Default is standard.
-DVELOCITY_DEVELOP_BASEDIR=/some/local/filesystem/path/search-main/generic.sesam/war/src/main/webapp commaseparated loadpath, default is nothing

See attached files for example on how to set up CATALINA_OPTS and screenshots.

catalina_opts.sh
SRC=$HOME/Source/TRUNK/minimal-search-main

# This defines the loadpath. Files residing in genericno.sesam.no will be loaded before the generic.sesam.no

TEMPLATES="$SRC/genericno.sesam.no/war/src/main,$SRC/generic.sesam/war/src/main"
export CATALINA_OPTS="-DVELOCITY_DEBUG=true \
                      -DVELOCITY_DEBUG_ON=true \
                      -DVELOCITY_DEBUG_STYLE=standard \
                      -DVELOCITY_DEVELOPERBAR_HIDDEN=false \
                      -DVELOCITY_DEVELOP_BASEDIR=$TEMPLATES"

catalina_opts_minimal.sh
SRC=$HOME/Source/TRUNK/minimal-search-main

# This defines the loadpath. Files residing in genericno.sesam.no will be loaded before the generic.sesam.no

TEMPLATES="$SRC/genericno.sesam.no/war/src/main,$SRC/generic.sesam/war/src/main"
export CATALINA_OPTS="-DVELOCITY_DEBUG=true \
                      -DVELOCITY_DEBUG_ON=true \
                      -DVELOCITY_DEBUG_STYLE=onmouseover \
                      -DVELOCITY_DEVELOPERBAR_HIDDEN=true \
                      -DVELOCITY_DEVELOP_BASEDIR=$TEMPLATES"

 © 2007-2009 Schibsted ASA
Contact us