Folks, i have an java server application running stand alone, this will get tcp connection and do some processing and send back some response as well. and i want to run this inside a Tomcat web server along with a web applcation. i will start the server application by mean of servlet using onload =1 in web.xml. so upon start of tomcat the server application is started as well. i expect both web applcaition and server application to run with the tomcat and share some singleton classes and common classes between them. i also have hibernate inside and would except that no issues with deployment of applications. kindly let me know if there are any issues with this or any suggestions.
Here are a couple of things to consider:
Your ServletContextListener will need to implement the following methods:
public void contextInitialized(ServletContextEvent event)
public void contextDestroyed(ServletContextEvent event)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.