English 中文(简体)
• 如何支持小游艇的参数?
原标题:How to Support Parameters with Play Mini s REST?

I m using Akka and Play Mini (which is just a REST layer on top of Netty). I m using it from Java. The syntax is simple, covered in their readme on GitHub:

    @URL("/coco/*/name/*")

这只是工作上的罚款,但意味着所有危房只能是漫长的道路。 我发现

    /search/query=dogs

Maybe the regular Play docs address this. Will keep searching..

最佳回答

也许这将有助于其他人。

@URL("/hello/*\?*")
public static Result show() {
    Map<String, String[]> queryString = request().queryString();

    Map<String, String> data = new HashMap<String, String>();
    for (String key : queryString.keySet()) {
        for (String value : queryString.get(key)) {
            data.put(key, value);
        }
    }
    response().setContentType("text/html");
    return ok(data.toString());
}

如果你测试<代码>curl”

结果是:

test{param1=0, param2=yes}
问题回答

暂无回答




相关问题
Actors: How to efficiently handle read-mostly data

Suppose I have an actor that has a single field. 99 out of every 100 messages to an actor read the value, and the 100th updates the value. In this case, I would like to process reads in parallel. In ...

Is it possible to run AKKA on Java 1.5?

Is it possible to run AKKA on Java 1.5? I m getting java.lang.UnsupportedClassVersionError: Bad version number in .class file for se.scalablesolutions.akka.actor.LocalActorRef. AKKA version is 0.9.1 ...

Which ThreadPool in Java should I use?

There are a huge amount of tasks. Each task is belong to a single group. The requirement is each group of tasks should executed serially just like executed in a single thread and the throughput should ...

Different Scala Actor Implementations Overview

I m trying to find the right actor implementation. I realized there is a bunch of them and it s a bit confusing to pick one. Personally I m especially interested in remote actors, but I guess a ...

Scala 2.8 Actors

We re looking at using actors in our Scala code quite soon. We re also thinking of moving to Scala 2.8 in the next few weeks. We ve been keeping an eye on Akka but it doesn t currently support 2.8 and ...

Composing actors

I ve implemented a Listenable/Listener trait that can be added to Actors. I m wondering if it s possible to attach this style of trait to an actor without it having to explicitly call the ...

热门标签