web/src/main/java/org/springframework/security/web/authentication/switchuser/SwitchUserFilter.java
@Override
	public void afterPropertiesSet() {
		Assert.notNull(this.userDetailsService, "userDetailsService must be specified");
		Assert.isTrue(this.successHandler != null || this.targetUrl != null,
				"You must set either a successHandler or the targetUrl");
		if (this.targetUrl != null) {
			Assert.isNull(this.successHandler,
					"You cannot set both successHandler and targetUrl");
			this.successHandler = new SimpleUrlAuthenticationSuccessHandler(
					this.targetUrl);
		}

		if (this.failureHandler == null) {
			this.failureHandler = this.switchFailureUrl == null
					? new SimpleUrlAuthenticationFailureHandler()
					: new SimpleUrlAuthenticationFailureHandler(this.switchFailureUrl);
		}
		else {
			Assert.isNull(this.switchFailureUrl,
					"You cannot set both a switchFailureUrl and a failureHandler");
		}
	}
@Override
	public void afterPropertiesSet() {
		Assert.notNull(this.userDetailsService, "userDetailsService must be specified");
		Assert.isTrue(this.successHandler != null || this.targetUrl != null,
				"You must set either a successHandler or the targetUrl");
		if (this.targetUrl != null) {
			Assert.isNull(this.successHandler,
					"You cannot set both successHandler and targetUrl");
			this.successHandler = new SimpleUrlAuthenticationSuccessHandler(
					this.targetUrl);
		}

		if (this.failureHandler == null) {
			this.failureHandler = this.switchFailureUrl == null
					? new SimpleUrlAuthenticationFailureHandler()
					: new SimpleUrlAuthenticationFailureHandler(this.switchFailureUrl);
		}
		else {
			Assert.isNull(this.switchFailureUrl,
					"You cannot set both a switchFailureUrl and a failureHandler");
		}
	}
========================================================================================================