Passing multiple parameter in app-engine Task Queue (JAVA)

回眸只為那壹抹淺笑 提交于 2019-12-10 13:08:14

问题


Is there a way to pass multiple parameters in a Queue in google-app-engine? I use the code below

Queue queue = QueueFactory.getQueue("sms-queue");
queue.add(TaskOptions.Builder.url("/SQ").param("id",pId));

in my servlet this id is retrievd as a query string.

long pID = Long.parseLong(req.getParameter("id"));      

I need to pass 6 parameters.


回答1:


Have you tried doing this:

queue.add(TaskOptions.Builder
    .url("/SQ")
    .param("p1Name", p1Value)
    .param("p2Name", p2Value)
    .param("p3Name", p3Value)
    // etc
);


来源:https://stackoverflow.com/questions/3107565/passing-multiple-parameter-in-app-engine-task-queue-java

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!