handling event in Tomcat
2 Message(s) by 2 Author(s) originally posted in java developer
| From: usguest |
Date: Thursday, September 09, 2004
|
Hi,
I am using Servlet and Tomcat to build a web application. I understand
that whenever there is a http request, a Servlet
thread is created to
handle it. However, I want to have my own
scheduler to handler those
event. Basically, I want to
queue all the incoming http request, and
execute as my order. Any advice on how to do that?
I'll appreciate any response. Thank you.
Stephen
| From: nathan.zumwalt |
Date: Saturday, September 11, 2004
|
Actually, Tomcat creates a pool of "worker" threads that process
incoming requests. Each request does not get its "own" thread.
I do not think there is any way you can do what you're talking about
with Tomcat... you're asking to fundamentally change the way it
processes requests. If you do not like the way it does this, you will
probably have to
write your own
server (which really is not that hard).
You could create a singleton
class with an associated thread, and pass
all incoming requests to that singleton... you'd still have Tomcat
creating threads, but you'd be able to better
control how the requests
were processed.
I'd look at the
design for your web application, though... this sounds
like a weird requirement to me.
//Nathan
wrote in
message Hi,
I am using Servlet and Tomcat to build a web application. I understand
that whenever there is a http request, a Servlet thread is created to
handle it. However, I want to have my own scheduler to handler those
event. Basically, I want to queue all the incoming http request, and
execute as my order. Any advice on how to do that?
I'll appreciate any response. Thank you.
Stephen
Next Message: Installer for JAVA app
Blogs related to handling event in Tomcat
Cartesian vs. Polar Coordinates Moving and Rotating Polygons
... Game-Specific Functionality Writing the GUI Code NetOthello s GUI Layout
Handling Events Implementing a Dialog Box Writing the Networking Code Threading NetOthello Getting the User Info Connecting to the Server
Handling Server Input
...
Trying out Grizzly ARP
SelectorThread; import
java.io.IOException; public class App { public static void
... ActionCode; import org.apache.
tomcat.util.buf.ByteChunk; import
java.io.
... new Runnable() { public void run() { asyncHandler.
handle(asyncTask);
...
Strange error w. ContextLoaderListener
Exception sending context initialized
event to listener instance of class org.springframework.web.context.ContextLoaderListener
java.lang.AbstractMethodError: org.springframework.jndi.config.JndiNamespaceHandler.init()V
...
Top 10 Coolest Things coming in JSR 286
Use of Annotations - This
Java 5 feature is being used to route
Event requests to the appropriate
event handling method in processEvent(). Oddly, Early Draft 1 doesn't mention that the same will be done for routing action requests to
...
GWT: AJAX framework for the Javascript averse
Very briefly, GWT allows you to build your Javascript widgets using
Java and the GWT widget class
... Events raised by clicking the "Go" button will trigger this method.
... The shell starts an embedded
Tomcat server on port 8888.
...
Miscellaneous :: 9/14 O'Reilly Newsletter
-How to Publish Multiple Websites Using a Single
Tomcat Web Application
... connectivity; working with removable devices; and even
handling DVDs and
... event brings nearly 2000 MySQL developers, DBAs, users, and partners
...