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

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

Introduction

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

Prototype

String DEFAULT_LOGIN_URL

To view the source code for org.apache.shiro.web.filter AccessControlFilter DEFAULT_LOGIN_URL.

Click Source Link

Document

Simple default login URL equal to /login.jsp, which can be overridden by calling the #setLoginUrl(String) setLoginUrl method.

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  ww  w  .  j  a  v a  2s  .  c  o  m
    }
}