Hi Pras, > How do I read System.getProperty("foo") within a Velocity file? I need > this to read a property and take corresponding action at the time of > initialization of my application. I can not put this code in any of the > methods within my Servlets and call the corresponding method from my > Velocity as during init-time, none of my Servlet classes are being invoked > until the user clicks on any one of the links in the web page.
How are you processing the Velocity templates? You always have the option to subclass VelocityViewServlet. http://jakarta.apache.org/velocity/tools/view/ Anyways, since you can't directly read System properties from templates, you can: - Put the System properties that you will use in the Context. - Put the whole System properties in the Context. - Put a tool that gets System properties in the Context. And get all you need via the Context. http://jakarta.apache.org/velocity/developer-guide.html#The%20Context > Probably might be a newbie question because it's just my 2nd week working on > Velocity. Any thoughts would be sincerely appreciated. Don't worry, that's how we all start. ;) Best regards, -- Shinobu -- Shinobu Kawai <[EMAIL PROTECTED]> --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]