}
};
}
private Application incrementCounter() {
return new Application() {
public void handle(Request request, Response response) throws Exception {
Session session = Session.get(request);
Integer counter = session.contains("counter") ? session.<Integer>get("counter") : 0;
session.put("counter", counter++);
response.body("Counter: " + counter);