Allow Servlet to Control "100-continue" response

2011-06-17 Thread Rehtron
Hi Currently if a client supplies the "Expect: 100-continue" header on a POST or PUT, Tomcat appears to send the response header ("100-continue") before passing control to the servlet. I need to use the servlet to control this response and accept/reject the request before receiving the request c

Re: Allow Servlet to Control "100-continue" response

2011-06-19 Thread Rehtron
entation depend on the Tomcat private implementation, that means I cannot use Jetty to do unit test. Can Servlet 3.0 Comet implement this? Thanks. Zijian. 2011/6/19 Pid > On 18/06/2011 06:53, Rehtron wrote: > > Hi > > > > Currently if a client supplies the "Expect: 100-c

Re: A Tomcat 6 Socket Server

2011-06-19 Thread Rehtron
Hi Tomcat is a Servlet container, Servlet abstract HTTP interaction, HTTP is application layer protocol, it encapsulate the socket and bytes processing. For socket processing, I think your should refer to some frameworks of transfer layer protocol like Netty, XSocket and Mina. Zijian 2011/6/19

Re: Servlet input/output streams

2011-06-22 Thread Rehtron
Hi You may use decorator pattern to decorate the input & output stream from Servlet to a UnclosableInputStream & UnclosableOutputStream, public class UnclosableInputStream extends java.io.FilterInputStream { public UnclosableInputStream(InputStream inputStream) { super(inputStream); } @Override

How to start & stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Dear all, I use org.apache.catalina.startup.Tomcat to do unit test, but the instance of which cannot be started or stopped correctly. I start and stop embedding tomcat for each test case, but first test can be passed, the second one will be failed by 503 Service, unavailable, the tomcat.start()

Re: How to start & stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Yes, I use same port for all test, but I think the port should be release after tomcat stopped. thanks. 2011/7/1 Mark Thomas > On 01/07/2011 10:07, Rehtron wrote: > > Dear all, > > > > I use org.apache.catalina.startup.Tomcat to do unit test, but the > instance > &

Re: How to start & stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
Windows XP, did you mean I should use different port for every test? Thanks. 2011/7/1 Mark Thomas > On 01/07/2011 10:29, Rehtron wrote: > > Yes, I use same port for all test, but I think the port should be release > > after tomcat stopped. > > What OS are you using? >

Re: How to start & stop embedding Tomcat correctly?

2011-07-01 Thread Rehtron
OK, thank you very much for your help! 2011/7/1 Mark Thomas > On 01/07/2011 10:56, Rehtron wrote: > > Windows XP, did you mean I should use different port for every test? > > I have seen all OSes hold on to ports after Tomcat has shutdown. Windows > isn't as bad as L