代码之家  ›  专栏  ›  技术社区  ›  Manjoor

在应用程序引擎任务队列(JAVA)中传递多参数

  •  6
  • Manjoor  · 技术社区  · 15 年前

    在googleappengine中,有没有一种方法可以在队列中传递多个参数?

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

    在我的servlet中,这个id作为查询字符串进行检索。

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

    我需要传递6个参数。

    1 回复  |  直到 15 年前
        1
  •  11
  •   Lauri Lehtinen    15 年前

    你试过这样做吗:

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