I am building a Sencha Touch 2 application with user-specific data sets.
Application Architecture:
Sencha Touch application <=====> Java server backend with REST services (many AJAX requests =))
In fact, I have:
- Log in with username / password
The application is initialized and the login form enters the game. After submitting the form as an AJAX request, the server server checks the user data and calls the client callback function.
And what I want to do:
Well, that is not a problem.
But how can I achieve the following:
Most of the data is specific to a single user and should be returned by the REST service, if necessary (by clicking on the navigation, ...). How can I send a sessiontoken (see above) in each AJAX request - so that the server can provide suitable datasets (provided that the token is valid)?
Send cookies in AJAX requests
, cookie , URL- , ? Java- (localhost: 8080), cookie - URL-, "app.json". , ?
AJAX
avi, "" ajax. AJAX, - Ext.Ajax, :-(:
(function() {
var originalRequest = Ext.data.Connection.prototype.request;
Ext.override(Ext.data.Connection, {
request : function(options) {
alert("Do sth... like add params");
return originalRequest.apply(this, options);
}
});
})();
ERROR:
: [] [ .Connection #] URL
Ext.Ajax.add({
listeners : {
beforerequest : function( conn, options, eOpts ){
alert("Do sth... like add params");
}
}
});
ERROR:
Uncaught TypeError: Object [object Object] 'add'
, ?
?
!