私は の新人ですsencha touch
。jersey
Java全体でメンバーレコードを作成、削除、更新する必要があります. これが私のコードです
view.js
Ext.define('bluebutton.view.BlueButton.testing', {
extend: 'Ext.form.Panel',
xtype: 'testing',
requires: [
'bluebutton.view.BlueButton.TransactionList',
'bluebutton.view.BlueButton.MemberPopUp',
'bluebutton.view.BlueButton.MemberDetail',
'bluebutton.store.BlueButton.MemberList',
],
config: {
id:'register',
items :[
{
xtype: 'textfield',
name: 'name',
label: 'Name'
},
{
xtype: 'emailfield',
name: 'email',
label: 'Email'
},
{
xtype: 'button',
text: 'Send',
handler: function(button) {
var form = Ext.getCmp('register');
values = form.getValues();
var myStore= new Ext.data.Store({
model: 'bluebutton.model.BlueButton.MemberList'
});
var newModel = Ext.ModelMgr.create({ 'memberId': 1,
'name': 2,
'imgUrl': 3
}, 'bluebutton.model.BlueButton.MemberList');
myStore.add(newModel);
myStore.sync();
}
}
],
}
});
Model.js
Ext.define('bluebutton.model.BlueButton.MemberList', {
extend: 'Ext.data.Model',
config: {
idProperty: 'memberModel',
fields: [
{ name: 'memberId' },
{ name: 'name' },
{ name: 'imgUrl' },
{ name: 'age' },
{ name: 'address' },
{ name: 'pointAvalaible' },
{ name: 'lastVisited' },
],
proxy: {
type: 'ajax',
actionMethods: {
create : 'POST',
read : 'POST', // by default GET
update : 'POST',
destroy: 'POST'
},
url: 'http://localhost:8080/RESTFulExample/rest/json/metallica/testingj'
},
}
});
Store.js
Ext.define('bluebutton.store.BlueButton.MemberList', {
extend: 'Ext.data.Store',
requires: [
'bluebutton.model.BlueButton.MemberList'
],
config: {
grouper: {
groupFn: function (record) {
return record.get('name')[0];
}
},
model :'bluebutton.model.BlueButton.MemberList',
storeId :'memberStore',
autoLoad:false,
pageSize: 5,
clearOnPageLoad: false,
data: [
]
}
});
Jersey.java
@POST
@Path("/testingj")
// @Consumes("application/x-www-form-urlencoded")
@Consumes(MediaType.APPLICATION_JSON)
public Response too(MultivaluedMap<String, String> form) {
return Response.status(201).entity(form).build();
}
しかし、私はこのエラーが発生し続けます
XMLHttpRequest cannot load localhost:8080/RESTFulExample/rest/json/metallica/testingj?_dc=1358408853016.
Origin localhost is not allowed by Access-Control-Allow-Origin.
解決策を教えてください。