Re: Deleting instance with REST & JavaMonitor
Re: Deleting instance with REST & JavaMonitor
- Subject: Re: Deleting instance with REST & JavaMonitor
- From: Pascal Robert <email@hidden>
- Date: Thu, 26 May 2011 15:06:27 -0400
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@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden