You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Shawn Church <sh...@boxity.com> on 2003/12/21 05:07:34 UTC

VelocityViewServlet properties

I'm beginning to evaluate Maverick, and so far it looks pretty good.  At the
same time, I am using VelocityViewServlet to handle the view rendering.  It
is working well for the most part, but I seem to be overlooking something
when registering a custom Velocity properties file.  VVS sees it correctly,
but the Velocity RuntimeInstance is apparently reverting to the default
config.

My web.xml contains:
<servlet>
	<servlet-name>velocity</servlet-name>

<servlet-class>org.apache.velocity.tools.view.servlet.VelocityViewServlet</s
ervlet-class>

	<init-param>
		<param-name>org.apache.velocity.properties</param-name>
		<param-value>/WEB-INF/properties/velocity.properties</param-value>
	</init-param>

	<load-on-startup>10</load-on-startup>
</servlet>

I am seeing this in my logs:

2003-12-20 21:12:56  Velocity   [info] VelocityViewServlet: Custom
Properties File: /WEB-INF/properties/velocity.properties
2003-12-20 21:12:56  Velocity   [info]
**************************************************************
2003-12-20 21:12:56  Velocity   [info] Starting Jakarta Velocity v1.4-rc1
2003-12-20 21:12:56  Velocity   [info] RuntimeInstance initializing.
2003-12-20 21:12:56  Velocity   [info] Default Properties File:
org\apache\velocity\runtime\defaults\velocity.properties

and I have these lines in my velocity.properties file:

file.resource.loader.path = /WEB-INF/templates
runtime.log = velocity.log

but my templates are not found unless I place them in the webapp root, and I
am not getting a velocity.log generated.

I have never had trouble with this configuration using VelocityServlet, but
VelocityViewServlet seems to not like it.  Does the above log entry for
"[info] Default Properties File:" mean it is actually using the default
velocity.properties, or is it just stating the default location?

I am using velocity-tools-view-1.1-beta1, and I've also tried
velocity-tools-view-1.0.

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: VelocityViewServlet properties (moved to dev list)

Posted by Claude Brisson <cl...@savoirweb.com>.
> it just has some different (and better :) defaults.  i'll have to remember to
> try and make better note of this in the docs somewhere.

maybe there is a more explicit way of setting those defaults than doing it programmatically from inside the VVS, like to distribute
a specific velocity.properties with the tools ?

otherwise we end up with a configuration that has nothing to do with the actual velocity.properties, in wich some properties will be
meaningfull and others irrelevant

just a thought

CloD



---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-dev-help@jakarta.apache.org


Velocity Common Services Engine

Posted by "Frans Thamura, Intercitra" <ja...@intercitra.com>.
I play with Turbine's Screen that use Velocity.

anyone know the engine smiliar with that that work well with Webwork or
Struts

The $screen_placeholder etc is cool, but I want to make a comparison.



Frans


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


RE: VelocityViewServlet properties

Posted by Shawn Church <sh...@boxity.com>.
> -----Original Message-----
> From: Nathan Bubna [mailto:nathan@esha.com]
> Sent: Sunday, December 21, 2003 2:14 AM
> To: Velocity Users List
> Subject: Re: VelocityViewServlet properties
>
> >
> > and I have these lines in my velocity.properties file:
> >
> > file.resource.loader.path = /WEB-INF/templates
>
> the default resource loader used by the VVS (WebappLoader) is set
> as "webapp"
> instead of "file" (as is typical when using the FileResourceLoader).  try:
>
> webapp.resource.loader.path = /WEB-INF/templates

That works, and from the WebappLoader javadocs it seems a better fit within
the context of a servlet container.  I'm having trouble getting to some of
the documentation at the moment since everything on the apache.org domain
has been down since yesterday evening.

> and on a sidenote, by default the VVS sends log messages through the
servlet
> API (ServletContext.log(String)), so this property is irrelevant unless
you
> also specify a different logger.

> > but my templates are not found unless I place them in the webapp root,
and I
> > am not getting a velocity.log generated.

>
> check your servlet container's logs. :)
>

That is where I found the VVS log entries referencing my
velocity.properties, but I normally get a velocity.log at the webapp root.
This might be better though, since if there are problems I usually end up
looking at more than one log file.

> > I have never had trouble with this configuration using
> VelocityServlet, but
> > VelocityViewServlet seems to not like it.
>
> it just has some different (and better :) defaults.  i'll have to
> remember to
> try and make better note of this in the docs somewhere.

No big deal; I really appreciate you taking the time to point me in the
right direction.

Thanks,
Shawn


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org


Re: VelocityViewServlet properties

Posted by Nathan Bubna <na...@esha.com>.
Shawn Church said:
> I'm beginning to evaluate Maverick, and so far it looks pretty good.  At the
> same time, I am using VelocityViewServlet to handle the view rendering.  It
> is working well for the most part, but I seem to be overlooking something
> when registering a custom Velocity properties file.  VVS sees it correctly,
> but the Velocity RuntimeInstance is apparently reverting to the default
> config.
...
> I am seeing this in my logs:
...
> 2003-12-20 21:12:56  Velocity   [info] Default Properties File:
> org\apache\velocity\runtime\defaults\velocity.properties
>
> and I have these lines in my velocity.properties file:
>
> file.resource.loader.path = /WEB-INF/templates

the default resource loader used by the VVS (WebappLoader) is set as "webapp"
instead of "file" (as is typical when using the FileResourceLoader).  try:

webapp.resource.loader.path = /WEB-INF/templates

> runtime.log = velocity.log

and on a sidenote, by default the VVS sends log messages through the servlet
API (ServletContext.log(String)), so this property is irrelevant unless you
also specify a different logger.

> but my templates are not found unless I place them in the webapp root, and I
> am not getting a velocity.log generated.

check your servlet container's logs. :)

> I have never had trouble with this configuration using VelocityServlet, but
> VelocityViewServlet seems to not like it.

it just has some different (and better :) defaults.  i'll have to remember to
try and make better note of this in the docs somewhere.

> Does the above log entry for
> "[info] Default Properties File:" mean it is actually using the default
> velocity.properties, or is it just stating the default location?

both, sort of.  it is using the default props, and it is stating where it
found them.

> I am using velocity-tools-view-1.1-beta1, and I've also tried
> velocity-tools-view-1.0.

both work the same in this stuff.

Nathan Bubna
nathan@esha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: velocity-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: velocity-user-help@jakarta.apache.org