Iain,

The RequestInitializableRequestProcessor interface from the example is
probably something you have to program yourself.  Create that interface,
and have all your handler classes implement it with the "init" method. 
This way when newPropertyHandlerMapping (that you are going to override)
is called, the mapping object that gets returned has a special
RequestProcessorFactoryFactory that initializes your handler for you --
with the "init()" method you implemented.

Does that make sense?  I haven't tried this method myself, but I assume
there is a bug in the faq; in the example code we're talking about:

 mapping.setRequestProcessorFactoryFactory(mapping);

should be:

 mapping.setRequestProcessorFactoryFactory(factory);

In my application I have lots a global controller that manages access to
application objects, so in my handlers, I grab a static reference to
that controller, from which I can get at the objects (or whatever other
resources you need) of interest.

E.g.:

BlahObject blah = BlahObjectController.getBlah(id);
....


--Ryan



Iain Bullard wrote:
> After sending the previous email I spent quite some time working on the
> problem and it turns out the terms
> I was using were not quite correct - let me explain some more....
>
> Having a persistent object within my servlet is quite straight
> forward, its
> getting that object to
> the xml-rpc handler that is the problem. A better way of stating my
> question
> would be:
>
> "how do I pass (persistent) objects to my handler methods from my servlet
> class"
>
> I have followed the example in the FAQ entitled "How to I get the
> clients IP
> address in a handler?"
> but I cannot get it to compile correctly as the class
> RequestInitializableRequestProcessor does not exist.
> Errors from compiling the example code:
> ~>javac @sourcefiles
>
> cannot find symbol
> symbol: class RequestInitializableRequestProcessor
>                        RequestInitializableRequestProcessor proc =
>                        ^
> MyXmlRpcServlet.java:65: cannot find symbol
> symbol: class RequestInitializableRequestProcessor
>                                (RequestInitializableRequestProcessor)
> super.newRequestProcessor(pClass, pRequest);
>                                 ^
> MyXmlRpcServlet.java:65: cannot find symbol
> symbol  : method
> newRequestProcessor(java.lang.Class,org.apache.xmlrpc.XmlRpcRequest)
> location: class
> org.apache.xmlrpc.server.RequestProcessorFactoryFactory.RequestSpecificProcessorFactoryFactory
>
>                                (RequestInitializableRequestProcessor)
> super.newRequestProcessor(pClass, pRequest);
>
> ^
> MyXmlRpcServlet.java:70:
> setRequestProcessorFactoryFactory(org.apache.xmlrpc.server.RequestProcessorFactoryFactory)
>
> in org.apache.xmlrpc.server.AbstractReflectiveHandlerMapping cannot be
> applied to (org.apache.xmlrpc.server.PropertyHandlerMapping)
>                mapping.setRequestProcessorFactoryFactory(mapping);
>                       ^
>
> At first I thought I had just not imported this class correctly from
> the 3.0
> release, so I downloaded the source code and
> searched for the class, alas it was not there. My next thought was "maybe
> its in the svn repository still.." So I got the latest source code
> from the
> svn and then ran the following commands:
>
> ~/src/xmlrpc-svn/trunk> find . -name
> RequestInitializableRequestProcessor.java
> ~/src/xmlrpc-svn/trunk> find . -name *.java -exec grep -i
> RequestInitializableRequestProcessor {} \;
>
> These commands both produce no output and that suggests to me that
> there is
> no file called RequestInitializableRequestProcessor.java within the
> source
> tree nor is there any mention of it within any of the other java files.
>
> In fact, the only place that it is mentioned within the svn repository is
> the faq file. So... If someone would be able to help me,
> how can I easily pass objects to my handler methods - or is there some
> other
> way recommended way of doing this?
>
> If I get this working correctly I will write up an example for the FAQ
> aimed
> at people who are not as familiar with the xml-rpc source.
>
> Thanks again for your time,
>
> Iain.
>


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

Reply via email to