0
当涉及到使用从我的Python API for Google App Engine生成的.JAR生成的API时,我有点困惑。调用Python API - Google App Engine
下面是一个方法和AsyncTask的示例,用于在数据存储中创建和存储Event实体。
您通常会使用请求/响应消息将数据传递给实体吗?
我有了一个insert()方法的事件类,但它不会让我过去的任何事件的细节,因为它没有任何setter方法/干将如请求/响应类
private void sendResultToServer(String eventDesc, String eventName,
String eventTime) {
ImhotepApiMessagesEventRequest newEvent = new ImhotepApiMessagesEventRequest();
newEvent.setEventDesc(eventDesc);
newEvent.setEventTitle(eventName);
newEvent.setEventTime(eventTime);
new SendResultToServerTask().execute(newEvent, null, null);
}
/**
* Handles the request to the Event Endpoint, to save a event, without
* blocking the UI.
*/
private class SendResultToServerTask extends
AsyncTask<ImhotepApiMessagesEventRequest, Void, Void> {
@Override
protected Void doInBackground(
ImhotepApiMessagesEventRequest... params) {
// TODO Auto-generated method stub
service.event();
return null;
}
AppEngine Java和Python API是分开的,并且移植Python代码将不起作用。你似乎错过了一些概念。您的示例是Java,因此您应该学习[Java Datastore API](https://developers.google.com/appengine/docs/java/datastore/)和[Samples](https://developers.google.com/appengine/ )。要回答您的问题,是的,您通常会在doPost事件处理程序中使用请求参数来将数据传递给实体,并从HTML表单或jQuery Ajax调用提交帖子。 –