Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes JSP and the fly likes jsp stuck at compiling port listening program. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp stuck at compiling port listening program." Watch "jsp stuck at compiling port listening program." New topic
Author

jsp stuck at compiling port listening program.

vincentfasf tan
Greenhorn

Joined: Feb 25, 2012
Posts: 2
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.
Wendy Gibbons
Bartender

Joined: Oct 21, 2008
Posts: 1107

PLEASE CAN THIS THREAD BE MOVED FROM JSP

The java class that is listening, (for ever?). i think it needs to spawn (sorry if that is old C terminology) a thread that will do the listening, so that the servlet doesn't hang.
The resultas from this thread need to be put somewhere, maybe a database.

now in the page that wants the results I would have a javascript or ajax item that has a clock and checks the database every now and then to update whatever you want to know about.
Andrew Moko
Ranch Hand

Joined: Dec 16, 2011
Posts: 55
Yes. You need an "ajax-push-server" technology to dynamically push data from server-client.

http://en.wikipedia.org/wiki/Comet_%28programming%29
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp stuck at compiling port listening program.