Hi David,
Here is how we construct a URL in our JSP:
<form action="${basketDetailUrl}/${status.index}?_method=PUT" method="post">
So the key differences are:
* ID is part of the main body of the URL - not a parameter
* we use PUT as opposed to "put" (not sure it makes any difference, but
haven't tested lowercase)
* _method is a URL parameter - not a form object
I'm guessing in your instance you will need something along the lines of:
http://localhost/service/json/customers/id?_method=PUT
This type of URL works nicely for us with JSON urls too (I noticed that your
URL contains a JSON context):
${pageContext.request.contextPath}/product-quantity/" + friendlyCode +
".json?_method=PUT
Regards
Stuart
On 13/05/2009 01:22, "David Whitehurst" <[email protected]> wrote:
Can someone show me using my example of how to use the PUT feature of
the REST Plugin. I'll provide my example that doesn't work. I need
to know if I'm setting this up correctly using GWT. I can't get it to
work. The Confluence showed id=Thrillers so I've also tried
&id=customers and that didn't work either. I'm using the REST Plugin
on top of AppFuse for DAO and service managers. I use RequestBuilder
in a static class to GET and POST. The GET part works fine.
private static String EDIT_CUSTOMER_URL =
"http://localhost/service/json/customers/";
private void postEdit() {
formCustomer.setId(CustomerTable.getSelectedCustomer().getId());
String url = EDIT_CUSTOMER_URL;
//url = url.concat(formCustomer.getId());
StringBuffer postData = new StringBuffer();
postData.append("_method=").append(URL.encodeComponent("put"));
postData.append("&id").append(URL.encodeComponent(formCustomer.getId()));
postData.append("&name=");
postData.append(URL.encodeComponent(formCustomer.getName()));
postData.append("&phone=");
postData.append(URL.encodeComponent(formCustomer.getPhone()));
Window.alert("Getting ready to post: " + postData.toString() +
" " + url );
// POST
RequestUtils.submitPost(url, postData);
restoreCustomerDetailPanel();
}
Thanks
David
--
David L. Whitehurst
http://www.capehenrytech.com ... Providing software instruction through
a sea of Technology.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]