On 15/06/2010 23:05, Md. Jahid Shohel wrote: > > I still see onDeploy has more potential then making it deprecated. There > are lots of things that developer can do when the application is > deploying. I can give one example, the spring integration I have written > (more details can be found on > http://code.google.com/p/doubleclick/wiki/clickspring) loads up the > spring context during the deploy time - > > <controls> > <control > classname="org.apache.click.doubleclick.injectspring.SpringControl"/> > > </controls> > > This is just an example that what we can do on deploy. There are many > other things we can do, we can prepare services common services which > need to intercept each call without writing a filter, we can prepare > services (spring, JPA, Hibernate) which will be singleton service > through out the application. And since its singleton and so the only > perfect place we can load up the singleton service is onDeploy. But I > totally agree with you, that this does not need to be a Control. We can > just make a separate one.
Doesn't a ServletContextListener make more sense for this? It provides proper lifecycle management inside a Servlet container as well as a shutdown routine. It is also the standard way to provide such functionality. > I agree with you, that there is no use case which can make .htm or .jsp > named folders. But logic wise it did not seems correct that we do not > check if its a file or folder. Any naughty developer can make a .htm > folder inside the / and that .htm folder will still be processed on > deploy time, and will try to figure out its variables and auto bind them. I just did a quick test on Tomcat6, created a folder called 'test.htm', and started up the app. The path passed into isTemplate() ended with a slash '/', so the check correctly returned false. Regards Bob
