All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.nutz.integration.shiro.ioc.NutShiroEnvironmentLoader Maven / Gradle / Ivy

There is a newer version: 1.r.69.v20220215
Show newest version
package org.nutz.integration.shiro.ioc;

import javax.servlet.ServletContext;

import org.apache.shiro.web.env.EnvironmentLoader;
import org.nutz.mvc.Mvcs;

public class NutShiroEnvironmentLoader extends EnvironmentLoader {

    protected ServletContext servletContext;
    
    public ServletContext getServletContext() {
        if (servletContext == null)
            servletContext = Mvcs.getServletContext();
        return servletContext;
    }
    
    public void setServletContext(ServletContext servletContext) {
        this.servletContext = servletContext;
    }
    
    public void init() {
        super.initEnvironment(getServletContext());
    }
    
    public void depose() {
        super.destroyEnvironment(getServletContext());
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy