package cs263w16;

import static com.google.appengine.api.taskqueue.TaskOptions.Builder.withUrl;

import com.google.appengine.api.taskqueue.Queue;
import com.google.appengine.api.taskqueue.QueueFactory;

import javax.servlet.*;
import javax.servlet.http.*;

import java.io.*;

public class Enqueue extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {
    	
        String querytitle = request.getParameter("querytitle");
        String city = "goleta";
        String longitude = "45.00";
        String latitude = "45.00";
        String question = "where is my vehicle?";

        // Add the task to the default queue.
        Queue queue = QueueFactory.getDefaultQueue();
        queue.add(withUrl("/worker")
				.param("city", city)
				.param("querytitle", querytitle)
				.param("latitude", String.valueOf(latitude))
				.param("longitude", String.valueOf(longitude))
				.param("question", question));

        //response.sendRedirect("/index.jsp");
    }
}
@@ -454,16 +454,52 @@
 %7B%0A    %09%0A
+        String enqueue = %22enqueue%22;%0A
         
@@ -1097,8 +1097,9 @@
 %0A    %7D%0A%7D
+%0A

Update Enqueue.java