Task queue java
- by user268515
Hi i'm new to Task queue java API i tried a simple Example for it. My idea is to redirect the queue file to a servlet and to print some statement in the servlet.But it doesn't work. i mapped web.xml and used default queue I didnt get any Error but the file is not redirected to servlet . this is the codee i followed
taskq.java
public class taskq extends HttpServlet {
public void doGet(HttpServletRequest req, HttpServletResponse resp)throwsIOException {
Queue queue = QueueFactory.getDefaultQueue();
System.out.println("taskqueue");
queue.add(url("/worker"));
}
worker.java
public class worker extends HttpServlet {
private static final long serialVersionUID = 1L;
public String s;
public void doGet(HttpServletRequest req, HttpServletResponse resp)throws IOException {
String s="crimsom";
System.out.println(s);
}
}
Please Help me on this issue.
Regards
Sharun.