-
22 Jan 2013 8:29 AM #1
Unanswered: Jersey not able to call Put mehod
Unanswered: Jersey not able to call Put mehod
Hi, i am new sencha touch. I need to update some record to my database by using restful proxy.
Here is my code
view.js
Code:var user = Ext.create('bluebutton.model.BlueButton.MemberList', { title: 'Ed Spencer', singer: 'ed@sencha.com'}); user.save({ success: function(user) { alert(user); user.set('title', 'sencha'); user.save(); //PUT /users/123 } });
model.js
Jersey.javaCode:Ext.define('bluebutton.model.BlueButton.MemberList', { extend: 'Ext.data.Model', config: { idProperty: 'memberModel', fields: [ { name: 'title' }, { name: 'singer' }, ], proxy: { type: 'rest', url: 'http://localhost:8080/RESTFulExample/rest/json/metallica/get', reader: 'json', actionMethods: { create: 'POST', read: 'GET', update: 'PUT', destroy: 'DELETE' }, reader: { type: 'json', root: 'Track' }, writer: { type: 'json', }, } // proxy: { // type: 'rest', // url: 'http://192.168.0.103:8080/RESTFulExample/rest/json/metallica/post' // } } });
But jersey.java no response. Please helpCode://--Update record @PUT @Path("/get") @Produces(MediaType.APPLICATION_JSON) public Track getTracktest1(@PathParam(value = "userID") String accountId) { Track track = new Track(); track.setTitle("Enter Sandman"); track.setSinger("Metallica"); return track; }
-
24 Jan 2013 6:11 AM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
So does your java method retrieve the request?
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
24 Jan 2013 6:58 AM #3
-
24 Jan 2013 7:12 AM #4Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,121
- Vote Rating
- 453
- Answers
- 3160
So change the actionMethod to POST instead of PUT
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
24 Jan 2013 7:17 AM #5


Reply With Quote