velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Kaufman" <BKauf...@zaplet.com>
Subject RE: VelocityViewServlet and velocity.properties
Date Wed, 02 Oct 2002 15:03:11 GMT
The standard servlet uses getRealPath(), which fails on web servers that don't explode the
contents of WAR files into a directory on your file system.

If that's the problemn, you'll need to override VelocityViewServlet.initVelocity() to call
ServletContext.getResourceAsStream() instead of getRealPath().

                                                      -- Bill K.


> -----Original Message-----
> From: Iain Young [mailto:Iain.Young@microfocus.com]
> Sent: Wednesday, October 02, 2002 7:32 AM
> To: 'velocity-user@jakarta.apache.org'
> Subject: VelocityViewServlet and velocity.properties
> 
> 
> Hi folks, I'm hoping someone out there can help this velocity 
> newbee...
>  
> I'm trying to use the VelocityViewServlet (in conjunction 
> with struts) in my
> webapp, but am having a few problems in the configuration. I 
> want to place
> the template vm files under a templates subdirectory, but 
> despite changing
> the setting in the velocity.properties file, I always seem to get a
> "resource not found" error.
>  
> Strangely, if I create a "dummy" servlet with just a loadConfiguration
> method in it, and set this to load at startup, then 
> VelocityViewServlet can
> find the files. Because of this, I'm guessing that there is probably
> something wrong with the VelocityViewServlet init routines, 
> and running this
> dummy servlet beforehand is correctly loading the config. 
>  
> Anyone got any ideas as to what might be going wrong?
>  
> Thanks,
> Iain Young
> 
> 
> --
> To unsubscribe, e-mail:   
<mailto:velocity-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:velocity-user-help@jakarta.apache.org>


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


Mime
View raw message