简体   繁体   中英

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

 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

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:

require:
- play -> secure

And I believe you have to protect the whole controller, using @With(Secure.class) before the class definition:

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

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

Add the following dependency in your 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

play ec

This command will make the module visible in your eclipse

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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