Hi,

after studying the api and the faq entry about initializing a request processor 
with some state (in this case the HttpServletRequest) i found similar hints to 
solve the problem:

Servlet:
1. overwriting "newXmlRpcServer" to save the request i a helper object

        protected XmlRpcServletServer newXmlRpcServer(ServletConfig pConfig)
        throws XmlRpcException {
                return new XmlRpcServletServer(){
                        protected XmlRpcHttpRequestConfigImpl 
newConfig(HttpServletRequest pRequest) {
                                MyContext context = new MyContext();
                                context.setRequest(pRequest);
                                return context;
                        }
                };
        }

2. overwriting "newPropertyHandlerMapping" to do the mapping
        PropertyHandlerMapping mapping = new PropertyHandlerMapping();
        MyProcessorFactoryFactory factory = new MyProcessorFactoryFactory(new 
MDBServiceContext());
        mapping.addHandler("Search", SearchWSManager.class);
        mapping.setRequestProcessorFactoryFactory(factory);
        ...


3. Custom ProcessorFactoryFactory
public class MyProcessorFactoryFactory extends
                StatelessProcessorFactoryFactory {
        private MyContext serviceContext;

        public MyProcessorFactoryFactory(MyContext serviceContext) {
                super();
                this.serviceContext = serviceContext;
        }
        
        protected Object getRequestProcessor(Class pClass) throws 
XmlRpcException{
        RequestInitializableRequestProcessor proc =
            (RequestInitializableRequestProcessor) 
super.getRequestProcessor(pClass);
        proc.init(this.serviceContext);
        return proc;
    }
}

But: This custom getRequestProcessor Method is never called, so the Request 
Processor is never initialized as i want to.

So: It seems possible to register custom RequestProcessorFactories, but i'm not 
able to figure that out. And the sample in the faq is not very helpful because 
it is even not compiling...

Some help?

Best Regards,

Tom
_____________________________________________________________________
Der WEB.DE SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
http://smartsurfer.web.de/?mc=100071&distributionid=000000000066


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to