daljeetsingh wrote:
>
> Hello
>
> I need to use a custom velocity.properties 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>velocity.properties</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
http://....../yourwebapp/servlet/MyServlet
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 velocity.properties file in
your webapp root (i.e webapps/webappname/ ).
See examples/servlet_example2 for some ideas on working with properties.
geir
--
Geir Magnusson Jr. [EMAIL PROTECTED]
System and Software Consulting
Developing for the web? See http://jakarta.apache.org/velocity/
You have a genius for suggesting things I've come a cropper with!