I am developing a web SNMP manager using JSP/Servlet. In the application, i have a java class which needs to keep on listening to a port after being call by JSP. Problem is because the java class must keep on listening to a port which mean the JSP will keep on compiling without end. Even after the java class stops, the JSP still continue to wait or worst, the java class won't be executed again when the JSP is run again because JSP only compiles the first time it runs. Is there any way to do this?
Only solution i can think of is after executing the java class through jsp, i let the java class to write any reply into database. Then i retrieve the data from database using another JSP/servlet. Still the jsp that first calls the java class still stuck there waiting for localhost.