Example usage for org.apache.shiro.web.filter.authc AuthenticationFilter getSuccessUrl

List of usage examples for org.apache.shiro.web.filter.authc AuthenticationFilter getSuccessUrl

Introduction

In this page you can find the example usage for org.apache.shiro.web.filter.authc AuthenticationFilter getSuccessUrl.

Prototype

public String getSuccessUrl() 

Source Link

Document

Returns the success url to use as the default location a user is sent after logging in.

Usage

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

License:Apache License

private void applySuccessUrlIfNecessary(Filter filter) {
    String successUrl = getSuccessUrl();
    if (StringUtils.hasText(successUrl) && (filter instanceof AuthenticationFilter)) {
        AuthenticationFilter authcFilter = (AuthenticationFilter) filter;
        //only apply the successUrl if they haven't explicitly configured one already:
        String existingSuccessUrl = authcFilter.getSuccessUrl();
        if (AuthenticationFilter.DEFAULT_SUCCESS_URL.equals(existingSuccessUrl)) {
            authcFilter.setSuccessUrl(successUrl);
        }//from  w w w .  j  a  va 2  s.  co m
    }
}