Example usage for org.apache.shiro.web.filter AccessControlFilter getLoginUrl

List of usage examples for org.apache.shiro.web.filter AccessControlFilter getLoginUrl

Introduction

In this page you can find the example usage for org.apache.shiro.web.filter AccessControlFilter getLoginUrl.

Prototype

public String getLoginUrl() 

Source Link

Document

Returns the login URL used to authenticate a user.

Usage

From source file:com.centfor.frame.shiro.FrameShiroFilterFactoryBean.java

License:Apache License

private void applyLoginUrlIfNecessary(Filter filter) {
    String loginUrl = getLoginUrl();
    if (StringUtils.hasText(loginUrl) && (filter instanceof AccessControlFilter)) {
        AccessControlFilter acFilter = (AccessControlFilter) filter;
        //only apply the login url if they haven't explicitly configured one already:
        String existingLoginUrl = acFilter.getLoginUrl();
        if (AccessControlFilter.DEFAULT_LOGIN_URL.equals(existingLoginUrl)) {
            acFilter.setLoginUrl(loginUrl);
        }/*from   www  .  j a  v  a 2 s  .  c  o  m*/
    }
}