DO NOT REPLY [Bug 48004] New: setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48004

   Summary: setHeader() does not replace the previous value for a
"Server"
   Product: Tomcat 5
   Version: 5.5.28
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Unknown
AssignedTo: dev@tomcat.apache.org
ReportedBy: olivier.du...@pwgsc.gc.ca


Hello,
In a servlet or in a filter (before passing the control to doFilter() or after)
try the following
HttpServletResponse myResponse = ...
myResponse.setHeader("Server","My own server name because I do not want to
expose the real server name to the public for security reasons");
...

In the headers of the response you will get
ServerApache-Coyote/1.1, My own server name...

According to the J2EE API for HttpServletResponse.html.setHeader()
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html#setHeader(java.lang.String,%20java.lang.String)
...
Sets a response header with the given name and value. If the header had already
been set, the new value overwrites the previous one. The containsHeader method
can be used to test for the presence of a header before setting its value.
...
In fact if I call myResponse.containsHeader("Server") I even get a false!!!

If you look in the IDE at the response object and dig in the responses and
wrappers, you will find at the end a buffer with some data already set by
Tomcat with this value and other things
.
As I understand it Tomcat (or Coyote) does not let this header to be changed
while nothing in the specification says that it is special.
I did not find either a parameter in server.xml or other where the server name
is specified to be overiden.

So the spec is not implemented properly for this specific header.
Some other values are in this buffer, my goal was not to change them but other
headers or values could have the same issue.

This issue is the same in Tomcat 5.5.28 and Tomcat 6.0.20. Not tested on 7.x.

Thanks 
Olivier

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48005] New: setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48005

   Summary: setHeader() does not replace the previous value for a
"Server"
   Product: Tomcat 6
   Version: 6.0.20
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: olivier.du...@pwgsc.gc.ca


Hello,
In a servlet or in a filter (before passing the control to doFilter() or after)
try the following
HttpServletResponse myResponse = ...
myResponse.setHeader("Server","My own server name because I do not want to
expose the real server name to the public for security reasons");
...

In the headers of the response you will get
ServerApache-Coyote/1.1, My own server name...

According to the J2EE API for HttpServletResponse.html.setHeader()
http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/http/HttpServletResponse.html#setHeader(java.lang.String,%20java.lang.String)
...
Sets a response header with the given name and value. If the header had already
been set, the new value overwrites the previous one. The containsHeader method
can be used to test for the presence of a header before setting its value.
...
In fact if I call myResponse.containsHeader("Server") I even get a false!!!

If you look in the IDE at the response object and dig in the responses and
wrappers, you will find at the end a buffer with some data already set by
Tomcat with this value and other things
.
As I understand it Tomcat (or Coyote) does not let this header to be changed
while nothing in the specification says that it is special.
I did not find either a parameter in server.xml or other where the server name
is specified to be overiden.

So the spec is not implemented properly for this specific header.
Some other values are in this buffer, my goal was not to change them but other
headers or values could have the same issue.

This issue is the same in Tomcat 5.5.28 and Tomcat 6.0.20. Not tested on 7.x.

Thanks 
Olivier

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48005] setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48005

olivier dupuy  changed:

   What|Removed |Added

   See Also||https://issues.apache.org/b
   ||ugzilla/show_bug.cgi?id=480
   ||04

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48004] setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48004

olivier dupuy  changed:

   What|Removed |Added

   See Also||https://issues.apache.org/b
   ||ugzilla/show_bug.cgi?id=480
   ||05

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48004] setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48004

--- Comment #1 from Mark Thomas  2009-10-15 12:31:43 BST ---
*** Bug 48005 has been marked as a duplicate of this bug. ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48005] setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48005

Mark Thomas  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||DUPLICATE

--- Comment #1 from Mark Thomas  2009-10-15 12:31:43 BST ---
*** This bug has been marked as a duplicate of bug 48004 ***

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] New: Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

   Summary: Implement the header X-Powered-By suggested by the
servlet specification
   Product: Tomcat 6
   Version: 6.0.20
  Platform: All
OS/Version: All
Status: NEW
  Severity: enhancement
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: olivier.du...@pwgsc.gc.ca


Hello,

The servlet 2.5 specification at 
http://jcp.org/aboutJava/communityprocess/mrel/jsr154/index2.html
suggests in section "SRV.5.2 Headers"

...
It is recommended that containers use the X-Powered-By HTTP header to
publish its implementation information. The field value should consist of one
or
more implementation types, such as "Servlet/2.4". Optionally, the
supplementary information of the container and the underlying Java platform can
be added after the implementation type within parentheses. The container should
be configurable to suppress this header.
Here’s the examples of this header.
X-Powered-By: Servlet/2.4
X-Powered-By: Servlet/2.4 JSP/2.0 (Tomcat/5.0 JRE/1.4.1)
...

This behavior is not implemented in Tomcat 6.0.20.
To make it totally clear, may I suggest to return the precise Tomcat and JVM
version with all the digits and the vendor such as Tomcat/5.5.28
JRE/SUN/1.5.0_12-b04)

Having this headers helps a lot the development team to determine what is
really running his application in test or production w/o asking to the
maintenance guy who is either often unreachable or not able to answer (YES).

Provide the option to remove the header through the configuration (file) or
through programming (see related bugs 48004 and 48005).

The servlet 3.0 specification at
http://jcp.org/aboutJava/communityprocess/pfd/jsr315/index.html
in the same section "SRV.5.2 Headers" says the same but I did not test for it
in Tomcat 7.

Thanks

Olivier

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.
-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

olivier dupuy  changed:

   What|Removed |Added

   See Also||https://issues.apache.org/b
   ||ugzilla/show_bug.cgi?id=480
   ||04

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

olivier dupuy  changed:

   What|Removed |Added

   See Also||https://issues.apache.org/b
   ||ugzilla/show_bug.cgi?id=480
   ||05

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48004] setHeader() does not replace the previous value for a "Server"

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48004

olivier dupuy  changed:

   What|Removed |Added

   See Also|https://issues.apache.org/b |
   |ugzilla/show_bug.cgi?id=480 |
   |05  |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

olivier dupuy  changed:

   What|Removed |Added

   See Also|https://issues.apache.org/b |
   |ugzilla/show_bug.cgi?id=480 |
   |05  |

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

Tim Funk  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID

--- Comment #1 from Tim Funk  2009-10-15 11:41:34 UTC ---
This is already available in conf/web.xml - default is off since its a waste of
bandwidth and a security hole. (information disclosure)

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48006] Implement the header X-Powered-By suggested by the servlet specification

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48006

olivier dupuy  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|INVALID |

--- Comment #2 from olivier dupuy  2009-10-15 
12:01:07 UTC ---
True that it's there in web.xml and even in the 5.5 version.
I agree that it is a security hole IN PRODUCTION but for a development and test
environment this is not a concern.

Moreover you do not have the precise Tomcat version and the precise JVM version

You have this header
ServerApache-Coyote/1.1
and this one
X-Powered-ByJSP/2.1

This should be like IMHO to be really useful something such as
ServerApache-Coyote/1.1
X-Powered-ByJSP/2.1 Tomcat/5.5.28 JRE/SUN/1.5.0_12-b04)

And if you consider this to be a security hole then the the server header is
also one and should be banned too for the same reasons.

Sorry to insist but the operation teams are not always what they should be and
this information saves time for some development teams like mine.

I am perfectly OK with a default value of "false" in web.xml to not show the
header for the reasons mentioned by Tim.

Thanks to consider my point of view

Olivier

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48007] New: ClassNotFoundException when deserializing custom object with FileStore

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48007

   Summary: ClassNotFoundException when deserializing custom
object with FileStore
   Product: Tomcat 5
   Version: 5.5.27
  Platform: Macintosh
OS/Version: Mac OS X 10.4
Status: NEW
  Severity: normal
  Priority: P2
 Component: Catalina
AssignedTo: dev@tomcat.apache.org
ReportedBy: mmalaid...@gmail.com


We're using the FileStore to make sessions persistent. Sessions are serialized
correctly, but every minute or so we get an exception like the following:

SEVERE: Session: 6D026DD0479F48B331D28EE8325095BB;
java.lang.ClassNotFoundException: com.whatever.spikes.session.CustomClass
   at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
   at java.security.AccessController.doPrivileged(Native Method)
   at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:319)
   at java.lang.ClassLoader.loadClass(ClassLoader.java:254)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:399)
   at java.lang.Class.forName0(Native Method)
   at java.lang.Class.forName(Class.java:247)
   at java.io.ObjectInputStream.resolveClass(ObjectInputStream.java:604)
   at
org.apache.catalina.util.CustomObjectInputStream.resolveClass(CustomObjectInputStream.java:78)
   at
java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1575)
   at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1496)
   at
java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1732)
   at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1329)
   at java.io.ObjectInputStream.readObject(ObjectInputStream.java:351)
   at
org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1407)
   at
org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:931)
   at org.apache.catalina.session.FileStore.load(FileStore.java:296)
   at
org.apache.catalina.session.StoreBase.processExpires(StoreBase.java:194)
   at
org.apache.catalina.session.PersistentManagerBase.processExpires(PersistentManagerBase.java:553)
   at
org.apache.catalina.session.ManagerBase.backgroundProcess(ManagerBase.java:664)
   at
org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1285)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1570)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1579)
   at
org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1559)
   at java.lang.Thread.run(Thread.java:637)

This doesn't happen if we put CustomClass in $CATALINA_HOME/shared/lib or
$CATALINA_HOME/shared/classes

Configuration:

   
   
 


Environment:
*) Mac OS/X 10.6.1
*) JDK 1.6.0_15
*) Tomcat 5.5.27

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48007] ClassNotFoundException when deserializing custom object with FileStore

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48007

--- Comment #1 from mmalaid...@gmail.com 2009-10-15 14:57:18 UTC ---
Check thread http://marc.info/?l=tomcat-user&m=125553788214052&w=2 at
tomcat-user

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



DO NOT REPLY [Bug 48007] ClassNotFoundException when deserializing custom object with FileStore

2009-10-15 Thread bugzilla
https://issues.apache.org/bugzilla/show_bug.cgi?id=48007

mmalaid...@gmail.com changed:

   What|Removed |Added

 CC||mmalaid...@gmail.com

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug.

-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org



svn commit: r825708 - in /tomcat/trunk: java/org/apache/catalina/connector/CoyoteAdapter.java java/org/apache/catalina/core/AsyncContextImpl.java webapps/examples/WEB-INF/classes/async/AsyncStockServl

2009-10-15 Thread fhanik
Author: fhanik
Date: Fri Oct 16 00:06:14 2009
New Revision: 825708

URL: http://svn.apache.org/viewvc?rev=825708&view=rev
Log:
Add some modifications to the state machine. Timeout and error are an async 
dispatch, and its unclear what the state should be. Since both those actions 
should stop the event, we set the state to COMPLETING

Modified:
tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java

Modified: tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java?rev=825708&r1=825707&r2=825708&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java 
(original)
+++ tomcat/trunk/java/org/apache/catalina/connector/CoyoteAdapter.java Fri Oct 
16 00:06:14 2009
@@ -272,7 +272,7 @@
//configure settings for timed out
asyncConImpl.setTimeoutState();
 }
-if (status==SocketStatus.ERROR) {
+if (status==SocketStatus.ERROR || status==SocketStatus.STOP || 
status==SocketStatus.DISCONNECT) {
 AsyncContextImpl asyncConImpl = 
(AsyncContextImpl)request.getAsyncContext();
 //TODO SERVLET3 - async
 //configure settings for timed out

Modified: tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java?rev=825708&r1=825707&r2=825708&view=diff
==
--- tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/AsyncContextImpl.java Fri Oct 16 
00:06:14 2009
@@ -72,7 +72,9 @@
 
 @Override
 public void complete() {
-if (state.compareAndSet(AsyncState.STARTED, AsyncState.COMPLETING) ||
+if (state.get()==AsyncState.COMPLETING) {
+//do nothing
+} else if (state.compareAndSet(AsyncState.STARTED, 
AsyncState.COMPLETING) ||
 state.compareAndSet(AsyncState.DISPATCHED, AsyncState.COMPLETING)) 
{
 // TODO SERVLET3 - async
 AtomicBoolean dispatched = new AtomicBoolean(false);
@@ -254,7 +256,7 @@
 }
 
 public void doInternalDispatch() throws ServletException, IOException {
-if (this.state.compareAndSet(AsyncState.TIMING_OUT, 
AsyncState.DISPATCHED)) {
+if (this.state.compareAndSet(AsyncState.TIMING_OUT, 
AsyncState.COMPLETING)) {
 log.debug("TIMING OUT!");
 boolean listenerInvoked = false;
 for (AsyncListenerWrapper listener : listeners) {
@@ -265,11 +267,17 @@
 ((HttpServletResponse)servletResponse).setStatus(500);
 }
 doInternalComplete(true);
-} else if (this.state.compareAndSet(AsyncState.ERROR_DISPATCHING, 
AsyncState.DISPATCHED)) {
+} else if (this.state.compareAndSet(AsyncState.ERROR_DISPATCHING, 
AsyncState.COMPLETING)) {
 log.debug("ON ERROR!");
 boolean listenerInvoked = false;
 for (AsyncListenerWrapper listener : listeners) {
-listener.fireOnError(event);
+try {
+listener.fireOnError(event);
+}catch (IllegalStateException x) {
+log.debug("Listener invoked invalid state.",x);
+}catch (Exception x) {
+log.debug("Exception during onError.",x);
+}
 listenerInvoked = true;
 }
 if (!listenerInvoked) {

Modified: 
tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java?rev=825708&r1=825707&r2=825708&view=diff
==
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java 
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java 
Fri Oct 16 00:06:14 2009
@@ -117,8 +117,7 @@
 
 @Override
 public void onComplete(AsyncEvent event) throws IOException {
-clients.remove(event.getRequest().getAsyncContext());
-if (clientcount.decrementAndGet()==0) {
+if (clients.remove(event.getRequest().getAsyncContext()) && 
clientcount.decrementAndGet()==0) {
 ticker.removeTickListener(this);
 }
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.o

svn commit: r825711 - /tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java

2009-10-15 Thread fhanik
Author: fhanik
Date: Fri Oct 16 00:09:48 2009
New Revision: 825711

URL: http://svn.apache.org/viewvc?rev=825711&view=rev
Log:
simplify example

Modified:
tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java

Modified: 
tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java
URL: 
http://svn.apache.org/viewvc/tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java?rev=825711&r1=825710&r2=825711&view=diff
==
--- tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java 
(original)
+++ tomcat/trunk/webapps/examples/WEB-INF/classes/async/AsyncStockServlet.java 
Fri Oct 16 00:09:48 2009
@@ -54,19 +54,6 @@
 @Override
 protected void service(HttpServletRequest req, HttpServletResponse resp)
 throws ServletException, IOException {
-//get the client Id, it should be in the URL
-String clientId = req.getParameter("clientId");
-//get the method this client prefers
-String method = req.getParameter("method");
-
-//if the client doesn't have a method defined, then we will assume it 
is POLLING
-if (method==null) method = POLL;
-//if the client hasn't specified its own clientId, abort
-//if (clientId==null) {
-//resp.sendError(404,"Client not found.");
-//return;
-//}
-
 if (req.isAsyncStarted()) {
 req.getAsyncContext().complete();
 } else if (req.isAsyncSupported()) {
@@ -131,10 +118,4 @@
 public void onTimeout(AsyncEvent event) throws IOException {
 event.getRequest().getAsyncContext().complete();
 }
-
-
-
-
-
-
 }



-
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org