Le 2011-05-26 à 14:38, Klaus Berkling a écrit :

> HI All.
> 
> I'm toying with the REST stuff in JavaMonitor and ran into a problem deleting 
> an instance.
> 
> This is the URL I send:
> 
>       GET 
> http://[host]:[port]/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/[AppName]/deleteInstance?pw=[password]&id=[id]

Hum, look like something is wrong. The method have:

        MApplication application = (MApplication) routeObjectForKey("name");
        deleteInstance(application, (Integer) routeObjectForKey("id"));

But "id" is not registered in the route:

        restHandler.insertRoute(new 
ERXRoute("MApplication","/mApplications/{name:MApplication}/deleteInstance", 
ERXRoute.Method.Get, MApplicationController.class, "deleteInstance"));

The ID should be fetched by request().numericFormValueForKey() instead of 
routeObjectForKey().

> My URL appears to be right but I get a 500 "Your request produced an error." 
> response.
> Am I doing this wrong or anyone know of a known issue?
> 
> This is the sample URL from the wiki:
> 
>       GET 
> http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/deleteInstance?id=1
> 
> The source in JavaMonitor does routeObjectForKey("name") and 
> routeObjectForKey("id"). Since there is a id=[id], this does not mean there 
> needs to be a name=[AppName]. Tried that.
> 
> 
> kib
> 
> "Live as if you were to die tomorrow. Learn as if you were to live forever."
> Mahatma Gandhi
> 
> Klaus Berkling
> Web Application Dev. & Systems Analyst
> DynEd International, Inc.
> www.dyned.com | blog | @kiberkli
> 
> 
> 
> 
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list      ([email protected])
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/webobjects-dev/probert%40macti.ca
> 
> This email sent to [email protected]

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to