You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@shiro.apache.org by manitas <ma...@gmail.com> on 2012/06/02 15:21:54 UTC

Re: Configuring logout.redirectUrl via Guice

Hi !

you need to use that :
bindConstant().annotatedWith(Names.named("shiro.logoutUrl")).to("/yoururl");



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Configuring-logout-redirectUrl-via-Guice-tp7577451p7577458.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Configuring logout.redirectUrl via Guice

Posted by juan rojas <ju...@rhemsolutions.com>.
I have the same problem with shiro-guice 1.2.1 so I did a workaround using a
custom filter extending LogoutFilter
/*does not work*/
//bindConstant().annotatedWith(Names.named("shiro.redirectUrl")).to("/login.jsp");
//addFilterChain("/logout", LOGOUT);

/*work fine*/
bindConstant().annotatedWith(Names.named("myRedirectUrl")).to("/login.jsp");
Key<MyLogoutFilter> MYLOGOUT = Key.get(MyLogoutFilter.class);		
addFilterChain("/logout", MYLOGOUT);


*My Custom Filter*

public class MyLogoutFilter extends LogoutFilter {

	@Inject
	@Override
	public void setRedirectUrl(@Named("myRedirectUrl") String redirectUrl) {
		super.setRedirectUrl(redirectUrl);
	}
}

Greetings...



--
View this message in context: http://shiro-user.582556.n2.nabble.com/Configuring-logout-redirectUrl-via-Guice-tp7577451p7577739.html
Sent from the Shiro User mailing list archive at Nabble.com.

Re: Configuring logout.redirectUrl via Guice

Posted by Thilo-Alexander Ginkel <th...@ginkel.com>.
On Sat, Jun 2, 2012 at 3:21 PM, manitas <ma...@gmail.com> wrote:
> you need to use that :
> bindConstant().annotatedWith(Names.named("shiro.logoutUrl")).to("/yoururl");

Unfortunately, this does not seem to work (redirectUrl remains
unchanged). Setting other Shiro properties via bindConstant() works,
though.

Any ideas?

Regards,
Thilo