找不到播放框架会话

时间:2018-10-09 11:09:47

标签: java session playframework

我目前是Stack Overflow的新手。我一直在学习Play框架,但现在我陷入了会议。我在编译代码时遇到此错误:


[info] Compiling 11 Scala sources and 13 Java sources to /home/patrick/workspace/helloworld/helloworld/target/scala-2.12/classes ...
[error] /home/patrick/workspace/helloworld/helloworld/app/controllers/Base.java:26:1: cannot find symbol
[error]   symbol:   method session(java.lang.String,java.lang.String)
[error]   location: class controllers.Base
[error]         session("connected", "user@gmail.com");
[error] (Compile / compileIncremental) javac returned non-zero exit code
[error] Total time: 2 s, completed Oct 9, 2018 5:57:49 PM

这是我的基础课

package controllers;

import forms.*;
import models.*;
import play.*;
import play.mvc.*;
import play.http.*;
import play.Logger;
import play.data.*;
import play.libs.concurrent.HttpExecutionContext;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionStage;
import javax.inject.*;
import java.util.List;

public class Base extends Action.Simple{   

    @Inject FormFactory formFactory;

    public CompletionStage<Result> call(Http.Context ctx) {
        Logger.info("Calling action for {}", ctx);
        // String user = session("connected");
        session("connected", "user@gmail.com");
        // Session("key", "example value");

        return delegate.call(ctx);
    }

}

有人可以帮助我找出错误所在吗?

0 个答案:

没有答案