diff --git a/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java b/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java index e0fbeaac062..806e3a911a1 100644 --- a/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java +++ b/appengine/taskqueue-push/src/main/java/com/example/appengine/taskqueue/push/Enqueue.java @@ -14,9 +14,11 @@ */ package com.example.appengine.taskqueue.push; +// [START import] import com.google.appengine.api.taskqueue.Queue; import com.google.appengine.api.taskqueue.QueueFactory; import com.google.appengine.api.taskqueue.TaskOptions; +// [END import] import java.io.IOException; @@ -33,9 +35,11 @@ protected void doPost(HttpServletRequest request, HttpServletResponse response) String key = request.getParameter("key"); // Add the task to the default queue. + // [START addQueue] Queue queue = QueueFactory.getDefaultQueue(); queue.add(TaskOptions.Builder.withUrl("/worker").param("key", key)); - + // [END addQueue] + response.sendRedirect("/"); } }