简体   繁体   English

在Playframework中确保安全

[英]Secure in Playframework

I'm trying to install secure module in playframework, I tried with http://www.playframework.org/documentation/1.2.2/secure but Secure.class isn't found 我正在尝试在playframework中安装安全模块,我尝试使用http://www.playframework.org/documentation/1.2.2/secure但未找到Secure.class

 import models.Task;
 import play.mvc.Controller;
 import play.mvc.With;

 public class Application extends Controller {

     @With(Secure.class)
     public static void index() {

Please any help please 请任何帮助

You have to add the module in the conf/dependencies.yml 您必须在conf / dependencies.yml中添加模块

It should look lie that : 它应该看起来像是在说谎:

# Application dependencies

require:
    - play
    - secure

Then you have to type the following command 然后,您必须键入以下命令

play dependencies your_play_app

I have the following in dependencies.yml: 我在Dependencies.yml中具有以下内容:

require:
- play -> secure

And I believe you have to protect the whole controller, using @With(Secure.class) before the class definition: 而且我相信您必须在类定义之前使用@With(Secure.class)保护整个控制器:

@With(Secure.class)
public class Application extends Controller {
    ...
}

如上所述,如果您使用的是Eclipse,请确保运行play eclipsify将Secure模块(及其类)引入项目。

Add the following dependency in your conf/dependencies.yml 在conf / dependencies.yml中添加以下依赖项

require:
- play -> secure

Then, use the commands to install secure module 然后,使用命令安装安全模块

play dpes

If you use eclipse, remember the use the command after "play deps" command 如果您使用eclipse,请记住在“ play deps”命令之后使用命令

play ec

This command will make the module visible in your eclipse 此命令将使模块在您的日食中可见

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM