質問

I'm using resin in one project. So far so good except for one little issue?

I created a generic method that takes any Object as the only argument but when I call the method it looks for the method name but with a different argument type, of course with the passed object type.

I'm not sure if Resin or any other Application Server can actually do this or am I making a mistaker here?

I'm developing the front end in Objective-j/Cappuccino and I'm mapping remote Java methods through CP2JavaWS.

Basically in Objective-J I declare something like this:

-(CPString) updateQuote:(id)modifiedQuote
    {}

I don't need to implement it, just declare it.

Then in my WebApp I declare and Implement the method like this:

public String updateQuote(Object modifiedQuote)
        {
      // implementation
        }

Then in the front end I call the method like this:

[DBManagerRemoteService updateQuote:aObject delegateRespHandler:@selector(success:) delegateFailHandler:@selector(failed:)];

The problem is that aObject is an instance of CYQuote class, so when I call the remote method it appears that is not looking for updateObject(java.lang.Object) and instead is looking for updateObject(com.myApp.services.CYQuote) which is not declared or implemented. Of course I could just implement a method for each class but my goal is to create a generic update method.

役に立ちましたか?

解決

I must answer myself and apologize for any inconvenience caused by my nonsense question. The issue had nothing to do with Resin or any Web Application Server. CP2JavaWS creates the Http Request based on the passed object so I am modifying it to accept some extra parameters.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top