velocity-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Geir Magnusson Jr." <>
Subject Re: how to use custom
Date Tue, 03 Jul 2001 10:20:57 GMT
daljeetsingh wrote:
> Hello
> I need to use a custom file for all the servlets in
> a web application.
> In order to do that I added the following to the web.xml
>     <servlet >
>       <servlet-name>org.apache.velocity.servlet.VelocityServlet</servlet-name>
>       <servlet-class>org.apache.velocity.servlet.VelocityServlet</servlet-class>
>       <init-param>
>          <param-name>properties</param-name>
>          <param-value></param-value>
>       </init-param>
>     </servlet>
> This change has not been sufficient for the velocity servlet to use the
> custom properties file in the loadConfiguration method ??
> What's wrong?

1) I would change <servlet-name> to something else, like 'MyServlet', so
you can 


in the browser

2) you will need to extend VelocityServlet, so the <servlet-class> much
change to your class that extends VelocityServlet.

3) the properties params are right - put the file in
your webapp root (i.e  webapps/webappname/ ).

See examples/servlet_example2 for some ideas on working with properties.


Geir Magnusson Jr.                 
System and Software Consulting
Developing for the web?  See
You have a genius for suggesting things I've come a cropper with!

View raw message