Ben*_*nny 2 java playframework
我是Play框架的新手,但我正在尝试使用安全模块而无法使其工作.
问题1 Eclipse无法解析Secure.Security:
package controllers;
import models.*;
public class Security extends Secure.Security {
static boolean authenticate(String username, String password) {
User user = User.find("byEmail", username).first();
return user != null && user.password.equals(password);
}
}
Run Code Online (Sandbox Code Playgroud)
问题2
NullPointerException:无法在null对象上获取属性'check'.
当我在我的观点中有以下内容时:
#{if secure.check}
...
#{/if}
Run Code Online (Sandbox Code Playgroud)
我已将安全模块添加到我的配置中.我错过了什么?
module.secure=${play.path}/modules/secure
Run Code Online (Sandbox Code Playgroud)
转到项目文件夹中的命令行并写下:
play clean // Clear previous compiled classes
play deps --sync // Add & Update missing dependencies like secure module
play eclipsify // You must run eclipsify again to show secure libs to your project
Run Code Online (Sandbox Code Playgroud)
然后转到eclipse中的项目,右键单击并刷新.再次重启.
单行命令: 播放eclipsify --deps --sync
| 归档时间: |
|
| 查看次数: |
1041 次 |
| 最近记录: |