On Thu, 2007-04-19 at 12:54 +0100, Bob Arnott wrote: > Is there a reason why HttpConnectionParams doesn't extend BasicHttpParams? > I'm having a play and am trying to create a HTTP Server based on the > non-blocking example. > > I've been trying to use Spring to inject all the necessary bits together, > but I see no way of creating a HttpParams object. The reason for this is > all the setX methods on HttpConnectionParams take a HttpParams object. Also, > all the methods on BasicHttpParams take two properties as well, i.e. key + > value, so I can't do: >
Bob, This issue has been discussed before. Please see this thread for some background info: http://www.opensubscriber.com/message/[email protected]/5874226.html > <bean id="connectionParams" > class="org.apache.http.params.HttpConnectionParams"> > <property name="soTimeout" value="5000" /> > <property name="socketBufferSize" value="8192" /> > <property name="staleCheckingEnabled" value="false" /> > <property name="tcpNoDelay" value="true" /> > </bean> > > Which I can in HttpClient: > > <bean id="httpClient" class="org.apache.commons.httpclient.HttpClient"> > <constructor-arg> > <bean > class="org.apache.commons.httpclient.MultiThreadedHttpConnectionManager"> > <property name="params"> > <bean > class="org.apache.commons.httpclient.params.HttpConnectionManagerParams"> > <property name="defaultMaxConnectionsPerHost" value="10" /> > <property name="maxTotalConnections" value="20" /> > <property name="connectionTimeout" value="7000" /> > <property name="linger" value="-1" /> > <property name="receiveBufferSize" value="4096" /> > <property name="sendBufferSize" value="4096" /> > <property name="soTimeout" value="900000" /> > <property name="staleCheckingEnabled" value="true" /> > <property name="tcpNoDelay" value="true" /> > </bean> > </property> > </bean> > </constructor-arg> > <property name="params"> > <bean class="org.apache.commons.httpclient.params.HttpClientParams"> > <property name="connectionManagerTimeout" value="10000" /> > <property name="contentCharset" value="UTF-8" /> > </bean> > </property> > </bean> > > > Are there any plans to provide for this kind of functionality, or am I going > to have to write my own implementation of HttpParams...? > Absolutely. I for one would love to be able to assemble HTTP services out of HttpComponents using Spring DI framework. Initialization of HttpParams is probably the only non-trivial problem that needs to be resolved to make that feasible. Please see this Jira ticker for some ideas about possible solutions: https://issues.apache.org/jira/browse/HTTPCORE-37 Please let me know if you need some more input on the subject. Oleg > Thanks, > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
