开发者

Secure in Playframework

开发者 https://www.devze.com 2023-03-26 16:03 出处:网络
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

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 {
    ...
}


As above, and if you're using Eclipse make sure you run play eclipsify to bring the Secure module (and it's classes) into your project.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消