Solon 插件开启静态目录-Solon论坛-开发交流-祥拓软件

Solon 插件开启静态目录

原文:点我查看

public class XOauthPluginImpl implements Plugin {

    private AopContext context;

    private StaticRepository staticRepository;


    @Override
    public void start(AopContext ctx) {
        context = ctx;
        staticRepository = new ClassPathStaticRepository(context.getClassLoader(), "static_oauth");
        StaticMappings.add("/", staticRepository);
    }

    @Override
    public void stop() {
        StaticMappings.remove(staticRepository);
    }

}

 

© 版权声明
请登录后发表评论

    请登录后查看回复内容