On 16/06/2010 23:13, marble4u wrote: > > Thank you, that helped a lot! I am new to j2ee... I have a lot of application > logic that will be used without representation as a jsp or a servlet: > > objects that extend TimerTask and register at a timer objekt. they execute > code which accesses a database (importer classes that collect data from > different sources and write it to a database once or twice a day). > > is that even possible with tomcat/j2ee? do i have to use beans for that > which use the resource annotation? i could easily do it with swing etc... > but i am asked to deploy it on an apache tomcat server with a web interface > (which show the tasks that will be executed). that's why i need the db > access. it would be nice if someone could lead me into the right direction - > just a rough outline - there is a lot information about standard use cases > (displaying webpages, guestbooks, etc...), but i think this is something a > little more special. thanks in advance!
Find and read the Servlet Spec v2.5. It's surprisingly easy to read for a technical Specification. There are a number of interfaces that you can implement which will give you interaction with the container but that don't depend on a request to trigger them. For example: the ServletContextListener, which has two methods one that fires when the application starts and one that fires when it stops. You could trigger the Timer in one, and cancel it in the other. p
signature.asc
Description: OpenPGP digital signature